Which is the fourth function? Do you mean the JP preference? What do you mean by ego functions? Do you mean Freud's definition of ego?
I, personally, stick to Jung. He doesn't talk about J or P.
Jung names 4 functions of the ego. The ego is consciousness, i.e. what I am aware of now. So, for example, I am conscious of the fact that Paris is the capital of France but until I went to use that as an example, that knowledge was unconscious...
The Freudian idea of the unconscious tends to focus on the troubling aspects of the personality but 'unconscious' is an adjective, not a noun.
So, you have 4 functions: Intuition, Feeling, Thinking and Sensing.
Jung says that all people have all of these but have a preference of which they use first and which they tend to neglect.
The tricky part is that both the 4th function, no matter what it is, and Intuition, involve the unconscious.
The unconscious is both subjective (personal) and objective (transpersonal). The 'Collective Unconscious', therefore, is better called the 'Objective Psyche' because what was unconscious can become conscious. The reason he calls it the 'Collective Unconscious' is because some contents simply cannot become conscious...they are too mysterious and/or abstract. Whether they will remain so, or whether they will become more palatable to the ego (consciousness) is something we will have to wait and see about.
Thoughts are not just made by people. They also come to people. In fact, before the emergence of the ego from the 'Objective Psyche', people were unable to differentiate their own consciousness from their surroundings, hence paganism and the idea of 'tree spirits' or 'river spirits' and so on.
To cut a long story short, the function that is least agreeable to your conscious attitude will always work against you in a way. It's like it's not even trying to do its job. That's why an Intuitive might suck at Sensing...because sensing is slacking off and the unconscious is always working against what you might call 'Willpower' to prevent you becoming too one-sided in anything you do. Therefore, because you (ego) have little control over 'Sensing', the unconscious has as much control as you do...it's inbetween conscious and unconscious.
There are no conincidences. The reason you're in the right place at the right time is because the unconscious psyche makes it so. If you find yourself in the opposite situation, you're trying to hard to be in total control of your own life.
Until you make the unconscious conscious, it will direct your life and you will call it fate.