Several things possible. If it's white foamy substance, it's caused from moisture in your crankcase.
1. Driving short distances- (engine not getting to full temperature).
2. Thermostat not working properly.
3. Head gasket leaking/cracked head letting moisture get in oil. If it is a thick black tar, it could be from broken down oil from lack of changes.
First be sure that the crankcase ventilation system is in good working order, if it isn't unwanted moisture may be getting into the crankcase. If the PCV system is in good working order and you still get gunk building up under the oil cap you may have the beginnings of a failed head gasket.
this is NOT normal! This gunk usually means that you have an excess of water (moisture) in your crank case. You should ck for an internal coolant leak
cholesterol.
A ugly dark colored gunk around the cap on radiator and on the refill tank. Wipe it with a paper towel and you can tell it is oil. That can mean alot of different things - need to get it checked out.
any gunk normally creamy under the oil cap normally is head gasket unless the vehicle hasn't been used for sometime then it could be condensation but that will go after a little while buy a bottle of k seal from the motor factors first before changing head gasket as this is really good stuff and is alot cheaper than a head gasket.
If it is a 4.7L it is normal for the oil cap to have slime in it. Other wise check/replace the pcv valve and crankcase filter.
your head gasket has blown,get a local garage to do a compression test,hope this helps, take the oil filler cap off the engine and check for a brown/greyish gunk, if so then your head gasket is blown.
cap that covers the oil fill hole in engine
An oil filler cap is a metal that covers the hole where the oil is poured.
Oil filler cap cover the hole in the engine where engine oil is added
From what I've read here. It might possibly be that your head gasket has blown. I had a load of gunk on my Oil Filler Cap today, Cleaned it of went for a long drive hasn't came back just yet so hoping all is good. But spark plugs being covered in junk dosent sound too good.
Oil is added on top of the valve cover. There is a cap, that usually says oil on it. Remove the cap and the oil can be added here.