Because theres a million manufacturers of every computer component (excluding processors) so hence a lot of cutthroat competition and price dropping.
There are 3 main bike component manufacturers (entire groupsets, we can exclude the likes of Tektro and Cane Creek that make levers and brakes), not only that many of their products serve different market segments (ie Shimano Sora, of which neither other company offers an equivalent "cheap" set).
So when you have manufacturers buying groupsets in bulk from only 1 or 2 of 3 total suppliers, the prices for them will definitely be cheaper.