What is Scotland's Gender Recognition Reform Bill? Why is it so controversial?

What is the Gender Recognition Reform (Scotland) Bill? Why is it so controversial? Who has been opposing the legislation? And will it definitely come into force?