Why can the connections of a recessed light be buried in drywall, but not junction boxes?
If you search this on the internet you will find the fixture can be disassembled and the j-box can be accessed through the hole that the fixture is in. Therefore the joints are still accessible. Like here.

If you bury a box under drywall it does not meet the definition of accessible according the Code since you would have to remove a portion of the building to access it.