What did the oil represent? There’s nothing magical about oil in itself, rather it is symbolic of the Holy Spirit.
Among the more than 200 times that oil is mentioned in the Bible, the connection as a metaphor of the Holy Spirit’s presence and action is clear in the ritual of anointing prophets, priests, and kings.
During the baptism of Jesus, he had the actual anointing of the Holy Spirit.[Jhn 1:32 KJV] 32 And John bare record, saying, I saw the Spirit descending from heaven like a dove, and it abode upon him.