It's necessary to lubricate the interior of a bike chain. The lubricant needs to sticky to stay in place. Sticky lubricant gets dirty. Lubricating a chain is a problem without an easy solution. It's always a compromise between keeping it clean and lubricated.
Synthetic lubricant is cleaner and longer lasting than mineral oils. These products are expensive but need to be used very sparingly and mean you need to lubricate a chain less regularly.
Where to lubricate a bike chain?
When the chain is clean and dry, put one small drop of lubricant on each chain link. Put the drop on the top of the bottom run of chain. Remember to make a mental note of where on the chain you started, to prevent repeat lubrication of the chain
The inside of the chain run is cleaner than the outside so there’s less chance of dirt being washed into the interior of the chain. Using the bottom run of chain means gravity helps the lube to run into the chain- this is the most appropriate place to lubricate a chain.