The second is "stock options" at private companies as compensation, which is what you are referring to. There are many variations on how this works.
I've seen companies, as a bonus, grant what amounts to a call option that can't traded and only exercised at some point in the future. This may be free or you might have to pay for it.
I was once given stock as a bonus at a startup, making me an owner. Being an owner didn't pay me any sort of dividend, but it massively complicated my income taxes by giving me a K-1 in May (after April 15th). Additionally, I owed tax on my percentage of ownership, which was really a pain. The other gotcha but I wasn't allowed to be an owner unless I worked there. So when I quit, I got cashed out at "fair market value," which was a B.S. number they made up and gave me a couple thousand dollars. I also got diluted by half while I was an "owner." The experience made me very leery of ownership. Now I just look for salary.