The role of the oil
The oil provides a viscous environment for the spring to work in, in each of the fork tubes.
It therefore works under pressure (even more so when the fork is adjustable, by means of valves which facilitate or restrict the oil flow), in an environment in which there are numerous friction points.
The fork oil can play a by no means negligible role in the dynamics of a motorcycle. A fork which is too soft, which bottoms over bumps or under hard braking can be stiffened up with a more viscous oil.
In general there are specific oils for conventional forks and also for the inverted type of forks used on competition or all-terrain machines.