Time for an economics lesson. I'll be brief about it.
The lifespan of a product depends on demand. Suppliers can only create so much demand through advertising and price adjustments. Ultimately, demand will hit a wall when the overall demographics a product can appeal to approaches saturation. So the main determinant of demand is appeal.
Few companies make products until they reach saturation. But when the cost of making the units is still less than what they make in selling them, most companies keep it up. When a product is in high demand, companies focus more resources into making that product. This makes production facilities more efficient at making them and allows them to require a smaller number of units sold per year to justify keeping the product in production. These factors combined are why the Atari 2600, NES, Game Boy, PlayStation, and PlayStation 2 all sold for as long as they did.
The reason why the GBA was cut short was due to impending competition from the PSP. Though the GBA would still have been easy enough to keep producing even as the DS and PSP took hold of the market, it made more economical sense to change GBA production facilities to DS production facilities. As the DS supports the GBA's most valued feature (playing GBA games), many would-be latecomer GBA customers would end up becoming DS customers anyway.