In Perth, Western Australia, we have electronic "Smart Rider" cards with a balance that uses NFC to register your ticket purchase as you enter and exit the station, bus, or ferry.
Some stations have turnstiles, but most don't.
If you tag on, but forget to tag off you are charged to the end of the line.
Ticket inspectors roam the network checking cards.
Currently to address cost of living concerns, fares are capped, so if you have a long commute, your ticket charge has drastically reduced.
You can top up your card either at a machine in the station, or via credit card payment. If you pay via card your fare is discounted. If you go a step further and automatically top up when your card drops below an agreed balance, your fare is further discounted.
Student ID cards also serve as Smart Rider Cards and IIRC travel is free.
You can link your car and bicycle to your card and tap to pay for parking at a station. You'll get fined if you don't travel within a set time of parking.
During COVID the government promoted free travel and could set pricing as required for specific times. (In WA we had our borders closed for much of the pandemic and only had a few lockdown events, travel was encouraged to stimulate the economy.)
Melbourne has a similar, "Myki" system, you can use the NFC in your phone to tag on and off. Perth has threatened to introduce that functionality, but it hasn't happened yet.
On the whole, the system seems to work.