Boeing certified that the battery would not cause an "on board fire" in one billion flight hours. As it happens, there were three fires in less than one hundred thousand hours of fleet time.
To be exact, no "on board fire" did happen, nothing outside the battery casing was burning, the fire was limited to the component and did not spread.
So although not at all a desirable situation, it is not yet proven that this battery fire was indeed a major thread to the safety of the aircraft. However, it is now an even lower risk as it will for sure always be contained...
Boeing got a waiver on the Li battery by rewriting the Federal register with the FAA. It was titled "special considerations".
Actually it is called "special condition", and this is an usual tool during certification of a design which is newer than the rules. When fly-by-wire was introduced for example, it was covered by the same procedures.