Onion routing is a network topology scheme used in the Lightning Network to increase privacy. The purpose of onion routing is to hide (encrypt) any and all non-essential node information when a transaction is passing through the Lightning Network from node to node. This means that a given node in the network only sees the information of the node that it’s receiving information from and the node it’s sending information to. Like the layers of an onion, this type of topology only allows an individual node to see the nodes that it’s adjacent to.
This type of routing is also seen in Tor browsers.