Every figure is a share of the whole company. When a programme takes a stake, everyone who already owns part of the company gives up the same proportion of what they hold.
A fixed stake is simple: 7% for US$125,000 means the deal values the company at US$125,000 ÷ 7% = US$1,785,714 once the money is in (its post-money valuation).
A post-money SAFE turns into shares at your next priced round. At its cap it is worth investment ÷ cap of the company, measured before that round's new money. If the round is priced below the cap, the SAFE converts at the round's price instead, which gives the SAFE holder more.
Each later round sells amount ÷ post-money valuation to its investors. A US$2m round at a US$12m post-money valuation sells 16.67%, and every earlier holder keeps 83.33% of what they had, the programme included.
Left out on purpose: option pool top-ups, other SAFEs or notes converting at the same time, pro rata purchases and liquidation preferences. Each one moves the numbers, so read the result as a first pass and check the real terms with your lawyer.