Your post was pretty general, Kroll. Gears in a gearbox should be in an oil bath, for instance. I am talking about lathe change gears here. That will work. So will wire rope lubricant. So will a NLGI #1 grease. Oil mostly drips and slings off. Grease will attract and hold chips, but the gears should be enclosed where chips cannot get into. I have a small amount of grease on my gears (Lubriplate 630-AA) and there are no chips in it...
Edit: I also clean the gears every time I change them.