Modern Vintage Gamer recently posted a video about how the Game Boy Advance knew when a Game Boy / Game Boy Color game was being inserted. The quick answer is GBA carts toggle a physical switch that enabled GBA mode, however this video goes into detail about the software side of things…including how GBC games could run in “GBA Enhanced modes”, even when the GBA mode was toggled.
Support MVG here: https://www.patreon.com/ModernVintageGamer
As a note, the physical switch issue is also why a ROM Cart like the GBA Everdrive can’t run in a GBC mode: While technically you could make a cart with pins on both sides, or even some complicated mechanical toggle, this would result in a product that’s far more expensive and don’t look anything like an original GBC/GBA cart. There’s also the voltage issue to deal with and while that’s solvable, it’s yet another cost. It’s much more cost-effective for both the designer and consumer to just get one of each:
Auto Amazon Links: No products found. http_request_failed: A valid URL was not provided. URL: https://ws-na.amazon-adsystem.com/widgets/q?SearchIndex=All&multipageStart=0&multipageCount=20&Operation=GetResults&Keywords=B079X2ZBGX&InstanceId=0&TemplateId=MobileSearchResults&ServiceVersion=20070822&MarketPlace=US Cache: AAL_ff24703c9697e423b0481783f795bf9b
Auto Amazon Links: No products found. http_request_failed: A valid URL was not provided. URL: https://ws-na.amazon-adsystem.com/widgets/q?SearchIndex=All&multipageStart=0&multipageCount=20&Operation=GetResults&Keywords=B0052URK0Q&InstanceId=0&TemplateId=MobileSearchResults&ServiceVersion=20070822&MarketPlace=US Cache: AAL_b4dffb4f319458cc3f444ee8a041dfae