Grease fittings are permanently installed by either a (taper) thread or straight push-fit ('hammer in') arrangement, leaving a nipple connection that a grease gun attaches to. The pressure supplied by the grease gun forces a small captive bearing ball in the fitting to move back against the force of its retaining spring. The arrangement is thus essentially a valve that opens under pressure to allow lubricant to pass through a channel and be forced into the voids of the bearing.
A less common design has a few names including 'button head', 'threepenny bit', 'flat' and 'tat head'. These are a larger nipple head with a flat sealing surface which overhangs the body of the nipple allowing the grease gun end to be hooked onto the nipple with a sliding action which wipes the nipple surface as it's attached.