|ppp over ssh|
A vpn can be constructed by running ppp over ssh.
A ppp connection is established between two computers when they run the "ppp program" reciprocally.
ssh (1) allows triggering an arbitrary program to run on a remote computer, (2) encrypts the data stream between the participating pair of computers.
If for (1) you choose the ppp program as your "arbitrary program," plus run it locally and reciprocally, the ppp connection gets established. But it flows unlike normal within an encrypted data stream.
If each of the computers serves a LAN it belongs to as a gateway, the two LANs collectively become a vpn:
virtual - because they are not a single network