The creator of the first ATM machine, John Shepherd-Barron, was unable to access his money one day when he arrived after the bank had closed. He came up with the solution to this problem while taking a bath, taking inspiration from the chocolate bar vending machines. – WTF Fun Facts
Source: https://en.wikipedia.org/wiki/John_Shepherd-Barron