I know it may be obvious, but for some it may not. In order to have grease that does not go rancid for a long time, you have to first "render" the grease, i.e. cook it. This means taking the raw fat, and cooking it carefully at a medium temperature, letting all of the light impurities cook and float to the top, and the heavy impurities cook and sink to the bottom. You have to skim the floating junk off of the top to get rid of it, and then slowly pour the good warm grease into a can or crock, and let it sit in a cool place until it solidifies. You have to make sure that you don't pour the bad stuff from the bottom of the pan into the can or crock as well. Once it solidifies, you have to keep a tight lid on it, or wax paper tied tight with string, and keep it in the coolest place possible. Otherswise, flies and insects will be all over it (and in it).
This may sound easy, but it's tricky. If you cook it at too high a temperature, you will burn the grease, or worse, create a raging grease fire that may be impossible to put out and burn your house down.
Bear grease was regarded in Colonial times as being the very best, lightest, smoothest grease. Beef tallow is harder to render, because it is denser. I don't know anything about rendering hog grease, but it is probably a better grease than beef.
I note that people are mentioning crocks alot. You can find lots of old crocks at little junk or antique shops in rural areas. They are very durable and were in widespread use up through the 1950s. Most of the 19th century ones don't have a lid, but instead have a broad mouth, with a short neck, into which a shallow ridge was cut (around the neck.) This was so you could put wax paper over the top of the bottle, and tie a string around the neck to hold the paper in place. The string sat in the ridge, for a tight grip. Crocks were particularly useful for storing butter, milk, cream, grease, or other heavy liquids, and you could then set the crock down into spring water to keep it cool.
Regards,
Mannyrock