How does a cash machine read money?

Vending machines are present in our society. People go with them and ingest them every day. They are settled in offices, retail companies, scrutiny offices, How does a cash machine read money?