In addition to the above, there is a microprocessor(similar to the intel or PPC you are using to access this forum, only much much smaller) and some associated ram and rom. The rom holds all of the software needed to boot your gameboy up when there is no cartridge installed as well as the programs needed to access the games stored on the cartridge and any programs needed to decipher the games.
This rom chip(depending on the system it can be external to the microprocessor or internal to the microprocessor) are factory "burned" with all of the required programs. Essentially, the rom chip is connected to another computer(like an intel running windows) and the software is sent from the source(intel) computer to a rom burner(a device the rom chip plugs into to connect to the source). The rom burner applies a higher voltage than the chip normally sees which causes transistors within the rom to burnout. Rom and Ram are simply huge arrays of transistors. The pattern of damaged transistors can be read by the microprocessor and intrepreted as a program.
The process is very similar to burning a CD except a CD is not a little black chip soldered onto a motherboard; however, the fundamentals are still the same. Data is permenately burned onto a medium in a pattern correlating to a program or some other form of data.
The older gameboys used Z80 processors and if you look you can find a lot of information on how to modify the original gameboys to run custom roms and custom game cartridges.
Here's a little cool gadget someone put together for an older gameboy:
http://www.semis.demon.co.uk/Gameboy/DsoDemo/DsoDemo.htm
Hope this helped.