INI format is a throwback to system.ini which was used in windows 3.11 in leu of a registry and is still used today. The format is popular because it doesn't have to be parsed manually. There is a windows api to automatically retrive the data as well some some otehr m$ stuff that'll do the job.
ini is this:
[Group]
key1=value
key2=value
[Group2]
key1=value
key2=value
When you search for a value you give the group name (in the case of mame it's usually the romname) and the key name and the api or whatever you are using returns the value. The beauty of this system is that you don't have to know the keys contained in a group as there is a call to get that data too. Then you can individually get teh value for each key in that game's group. This format has issues in 98 though when it gets excessively large. No such issues in xp though.
Nplayers.ini and controls.ini are the same format, it's just nplayers has a single group [nplayers] and each romname is a key. This is acceptable because nplayers only has one bit of data. Since controls.ini has more it makes a group for each rom.
Dat is a generic term. There's no such thing as a dat file anymore. As it pertains to mame, however, dats are all based on the old listinfo format. Open up and clrmamepro dat file and you can see this format. There isn't much standardization amoungst the various dat files (history, info, ect) other than the fact that each entry starts with a "$game=" or "$info=" and ends with an "$end". Basically each line is indented (why?) and the very first word is the key name followed by the data. These dats pretty much have to be parsed manually, and unless your goal is to display this data inside the mame ui, there isn't any point in using said format. The one thing dat files can do that ini files can't is have a multiple line value. You can have a really long value in an ini file, but not one with multiple lines. There are ways around the limitation though.
Dat files are often maintained manually in notepad as they are just ascii text. Many of the simplier ini files are handled manually (catver, nplayers) but more complex ones are usually outputted by a database or program. You really have to determine a set of fields and the data that will be stored in them before it's even possible to determine the format or how to maintain it.