A lot of times they do a basic function that isn't hard for an emulation developer to reverse engineer that was used on a PCB for things like protection. Like when using an identical motherboard for lots of different games but wanting to stop people from pirating all the new games that come out for it onto an old game with reading and writing new roms with an eprom programmer instead of buying a new game from the company. Pals can be protected so you can't read them out with store bought equipment, and in most cases that would stop people from being able to take an old game and upgrade it for free to a brand new game. Unfortunately the other end of the stick is people buy old games these days then have a dinky little pal chip die and then the whole game is dead and they can't revive it. This is probably the biggest database:
Most of the time in mame when they are added they are loaded but not used so we can keep up with them but because of the rare emulation use they are usually just not added. They could one day be used in a different way in mame but at this point I think their functionality is faked in simple code. That's my understanding of it anyway, I'm not a dev.