You can not compare them because both are good in their own ways, I am mentioning some of the points that you can consider before choosing them:-
Selenium is in the mainstream.
RPA is in budding field.
You will find plenty of testers available for Selenium-based web automation.
There are very less RPA testers so competition is also less.
If you want to choose the best tool between Selenium and RPA, you will find both are best in their own way.
There are many companies who are using Selenium as it is freeware, if you are good at selenium you can get job very well.
There are very less companies who are using RPA because it is an expensive tool.
Competition is less in RPA, so as the job opportunities are also less compared to Selenium.
You must read the following Selenium Tutorial to learn it in a better way, here is the video tutorial which you can refer to in order to learn these two technologies. .
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat Selenium certification!