The three usual arrangements are a key the child carries, a keypad lock with a code, and a combination of the two.
A key is simple and needs no batteries. Its weakness is that children lose keys, and a lost key with an address label, a school name or a distinctive keyring can lead straight back to the house.
A keypad lock removes the key from the equation. The child learns a code, nothing can be lost, and the code can be changed if it is shared. Its weaknesses are batteries, the need for a mechanical backup, and the risk of the code being watched or passed on to friends.
Many families end up using both: a keypad for everyday entry, with a key kept somewhere reliable as a backup.