There are some brands of bicycles that can cost more than the down payment on a car. Why? Surely making a bike lightweight and reliable isn’t so difficult that it warrants that price? Is it just the brand name or maybe it has to do with customization options?
To be fair, the OP did say “some brands” not ALL bikes. Also, I have one of those Walmart bikes and I pity the foo who owns one. On my very first ride, my pants tore the chain guard off. Pretty sure it was there to protect my pants. Then when I came to a stop, the seat exploded. Springs, nuts, bolts and washers went flying. I had to gather them up again and try to piece it back together to keep the seat usable. It’s ridiculously heavy too. If you can’t afford a nice new bike, I recommend buying a decent used one at a garage sale or something. I don’t agree that they will serve the vast majority of people just fine.
Not to “victim blame” because such unsafe junk should not be sold. But a $100 bike with amortized seat and spring suspension of wheels has no right to be durable. But an $100 simple bike with shimano gears or no gears can last for years.