A SAFE grants an investor the right to obtain equity at a future date if the startup sells shares in a future financing. It has been historically used by top startups in Silicon Valley raising money from accredited angel investors. You should only invest in a SAFE if you believe that the startup can raise financing in the future from professional investors.
Early-stage startups use SAFEs to delay the difficult task of figuring out how much a startup is worth. It's also a much cheaper and simpler contract than priced equity rounds, which may require months of negotiation and upwards of 30 pages of legalese costing tens of thousands of dollars.
The number of shares you receive is determined at the next priced financing when professional investors – typically venture capitalists – set the price for preferred stock. Then, calculated by using the Valuation Cap and sometimes the Discount Rate, your SAFE often converts into shares at a lower price than the venture capitalists paid, since you invested earlier.
The Valuation Cap is the most important term in this security. It puts a maximum price on the price of the stock - the lower the price, the more shares you will get. If you invest in a startup with a valuation cap of $8 million, and they later raise at a $20 million Pre-Money Valuation, the amount of stock you'll get will be priced off the $8 million number. But, if the next investors value the company at $4 million, that will be your price instead (perhaps further discounted by the Discount Rate).
Unlike a Convertible Note, a SAFE is not a loan. As such, it does not accrue interest, have a maturity date, or have a legal obligation to be paid back. This makes it a simpler and cheaper way to finance a startup, and it typically better aligns with the intention of most early stage equity investors who never intended to be lenders (convertible notes are rarely if ever paid back in cash despite being a debt instrument – the startup just goes bankrupt).