There are many scenarios that can lead to these situations. I can't cover them all here. I'll go over what I think is the most important reality to understand in the electronics/hardware game.

First, please understand that chip manufacturers don't exist to sell hobbyists or startups a few dozen to a few hundred chips per year. They need to sell anywhere from tens of thousands to hundreds of thousands of components per month. That's their reality. The bulk of their existence is devoted to producing lines of components that are, to varying degrees, pre-sold under contract and allocated to specific products and manufacturers.

Each component category has different dynamics. What's true for common grade ceramic capacitors and resistors might not be true for the high-grade capacitors needed in power distribution systems for high speed boards. The realities for pushbutton switches are different than what happens in the manufacture of integrated circuits, sensors or connectors.

Except for real commodity items that everyone uses (SMD 0402 5% resistors) lots of components are simply not manufactured outside of solid contractual arrangements with OEMs. This is necessary in order to plan volume manufacturing and, therefore, reduce costs.

For example, it isn't rare to have a component manufacturer ask an OEM for a product plan and projected volumes before even agreeing to sell them a part. The processor in the RaspberryPi falls under this category. There are a number of chips in consumer products that are not available for general low volume purchasing. You can't even get a data sheet unless you can show that you are going to consume the chips in volume.

The point is that the component business, be it switches or IC's is all about volume.

How do small volume users get parts then?

I am going to over-simplify this and simply say that we get to buy what's left over after fully allocated production runs. If you want to buy a component that is being driven with demand by, say, Apple, you can --and will-- run into "allocation" events. These are points in time when the chip manufacturer is contractually obligated to deliver x number of chips to Apple. If there's nothing left for non-contractual customers to feed on they simply have to wait until the next production batch.

Distributors go out and sell these chips. They book orders and feed the numbers to the chip manufacturer. Most of these orders require that you agree to "NCNR" terms. "NCNR" means non-cancelable and non-refundable. In other words: You own what you ordered and there is no way out of the deal. They do this because the chip manufacturer will aggregate all of these orders and tack on that number to the batch they are running for their contractual customers.

The accumulation timeline is variable and often depends on market conditions. During the economic downturn (roughly 2008 to 2010) thousands of parts went on allocation. Lead times got out to 20, 30 even 40 weeks. Yes, if you picked the wrong part you had the very real possibility of having to wait almost a year to get in on a manufacturing run. Why? Because nobody was buying anything and they couldn't aggregate enough orders to justify making a run.

The other --and far more complex-- aspect of this is the need to equalize manufacturing volume. In order to support their infrastructure component manufacturers would rather have a steady and reasonably uniform level of orders per unit time (say, per month or quarter) than crazy unpredictable spikes. This means that they might very well force allocation or control events on the supply in order to group orders and schedule them as necessary. It makes no sense to, for example, increase costs significantly during a month when an abnormal spike in volume occurs when you can often simply tell the OEM that their parts will come out of the next run in four to ten weeks.

Distributors will only stock components they know they can turn over quickly. Inventory turns per quarter or year is THE king metric in any business that holds anything in a warehouse. If distributors stocked rarely used components in order to be able to provide you with short lead times they'd lose tons of money and possibly cause enough self-mutilation to go out of business. And so, in the context of an entire ecosystem that has to remain healthy through variable market conditions there is no choice but to have delivery lead times that are "impedance matched" to what's going on with the entire pipeline and not the needs of a lonely small to mid-sized OEM that isn't really floating the boat.