It's been a long time since we set the rules for these, but I believe it is the 'least outputting' facility, meaning it factors both loyalty and supply together when deciding which one to shut down, as both affect output. Since you pay the same maintenance for each one, the one that's giving you the least output is considered the least efficient.
No, it doesn't do that. 6.8.1 at least still scraps the last added facility. If you build 6 IG, wait a year, build another 6 IG, and then scrap three, they will come out of the second set. If you invade another country, its facilities get added to the end of your list, and so get scrapped first. Maybe this was changed to the behavior you mention in SRCW. That would be a very good thing indeed, since scrapping facilities in invaded countires is one of the most frequent and tedious tasks in the game.