If you've searched for these capsules online, you've probably seen the confusion: gachapon here, gashapon there, gacha alone in video games. Are they different things? No. Is there an explanation for the mess? Yes, and it's quite curious.

Gashapon: the brand
Gashapon (ガシャポン) is a registered trademark of Bandai, the Japanese toy giant. It's like the case of paper tissues: the brand became so big that many people call all of them by that name, regardless of who makes them. That's why you'll see "gashapon" in lots of stores and ads — technically, only Bandai's should be called that.
Gachapon: the generic term
Gachapon (ガチャポン) is the free term, the one that applies to any capsule machine, regardless of the manufacturer. It comes from the onomatopoeia gacha-gacha (the crank) plus pon (the capsule falling). It's the name we use, among other things because we don't like to appropriate other people's brands. Well, and because Don Gashapon sounded worse.
Gacha: the digital offspring
Gacha alone has taken on its own meaning thanks to video games: "gacha games" (Genshin Impact and company) copy the mechanic of inserting a coin and receiving a random prize. Same psychology, zero figurine to put on the shelf. We're into physical gacha: the one that crinkles when you open it.
And the formal name
In official Japanese, they are kapuseru toi (カプセルトイ), capsule toys. It's the term manufacturers use in catalogs. No one says it out loud, just as no one says "adhesive tape" when they can say Scotch tape.
Summary to go: it's all the same. Japanese surprise capsules with a figure inside. Whether you spell them with ch, with sh, or short, we'll understand you just the same.