You put your card in, the machine reads the magnetic strip (or chip) and checks the PIN you enter and your available balance. You ask for some money, if you have the funds to cover it, the machine dispenses it.
The amount of cash inside one can vary, a machine on a busy high street on a Saturday will be stocked with more cash than a machine in the middle of nowhere midweek.
i used to fill one of the these and balance them twice a week. usually put in about 120-130k on a friday and maybe another 40-50k in the middle of the week. theres a series of belts and pulleys that pull the money out of trays in a safe section of the machine. they did tend to jam pretty often when old notes were put in. they are very sensitive to bent corners on notes which caused a major headache for my branch as each one was monitored on the downtime of the atm.