Tor uses onion routing: your traffic is encrypted in multiple layers and sent through a circuit of three relays (guard, middle, exit). Each relay peels off one layer of encryption, and only the exit relay sees the destination. The Tor network is centrally coordinated by directory authorities that maintain the list of relays.
I2P uses garlic routing: multiple messages are bundled together and encrypted, then sent through unidirectional tunnels. I2P uses separate inbound and outbound tunnels, and traffic is distributed across the network using a distributed hash table (DHT) rather than central directory authorities. This makes I2P more resilient to targeted attacks on infrastructure.
Tor's circuit-based model is efficient for accessing clearnet websites through exit nodes. I2P's tunnel-based model is optimized for internal services (called eepsites) where both the client and server are inside the I2P network. I2P has no built-in exit node functionality - accessing the regular internet through I2P requires outproxies, which are scarce and less reliable than Tor exit nodes.