I actually was part of the retro emulation scene in a former life, have coded NES demos, and have written NES and SNES emulators. So I can give further details if desired and/or redirect you to pages with more info if you're interested in pursuing this.
Or did they do it all in Assembly?
This. Games were not compiled from a HLL until PSX/GBA era. I think GBA may have been one of the first popular systems to commonly run from HLL compiled programs.
NES, SNES, Genesis, Master System, and Gameboy classic were certainly coded for in assembly.
But I want to know if anyone here knows if they used some standard libraries, APIs or the like, what language, or is all of that managed to be kept hidden?
There are no libraries. You communicated with hardware via direct register access. To write software you had to be familiar with both the assembly language and the register layout of the system you're coding for.
I'd also like to know about the kernel on the system as well, or did the game's run directly on the hardware?
No kernel. Most of them didn't even have a BIOS. The only executable code was provided by your program.
I was ninja'd by iHutch. Yes, there are (now) C libs for Genesis, NES, and possibly some others. But they didn't exist back when these systems were mainstream.
And quite frankly, you likely will get crap performance out of a compiled language on these systems. I do not recommend coding in C or any other HLL for these platforms.
I don't believe a 16-bit game like Yoshi's Island was programmed entirely in 16-bit Assembly. How could they manage such extensive data and code regarding a game with dozens of images, backgrounds, sounds, music, graphics and screen data, animations, artificial intelligence, and on top of all of that they implemented a gravity and level layout system.
Hard to believe it was ALL done in Assembly; that's almost machine code itself.
I still think they must have had some way of making the process more feasible.