How Do Gas Station Nozzles Work?

Gas stations might be some of the coolest feats of engineering we encounter on a regular basis. How exactly do gas nozzles work?
Shelby Rogers