Short version
The Secretaries of State for Scotland, Wales and Northern Ireland are responsible for policy where it differs from England.
For example, the police in England are the responsibility of the Home Secretary. The distinct challenges of policing in Northern Ireland are handled by the Northern Ireland secretary.
Longer version
The UK is governed by a Parliament located in Westminster. In the British model, Parliament is the one and only source of governing authority. (This differs from federal countries such as the USA, in which states have constitutional authority which cannot be arbitrarily overruled by central government.) Parliament can delegate or devolve some of its authority to local governing bodies.
Some functions of government are exactly the same across the UK. For example, state pensions are administered and paid by central government, and are the responsibility of the Secretary of State for Work and Pensions.
Others differ between the UK's constituent nations. For example, Scotland has always had a separate education system, with significant differences from its counterpart in England.
Prior to 1999, decisions were made by Parliament and implemented by the appropriate Cabinet minister. For example, the Secretary of State for Scotland would have administered changes made by an Education Act specific to Scotland as they relate to the parliament in Westminster.
In 1999, powers were devolved from Westminster to the Scottish Parliament, Welsh Assembly, and Northern Ireland Assembly. These assemblies and their respective executives (the Scottish Government, the Welsh Government and the Northern Ireland Executive) and now handle policy specific to Scotland, Wales and NI. For example, the Scottish Government has its own Minister of Education, who is responsible for the Scottish education system. The Minister of Education at Westminster handles this policy area for England.
Now, the main duty of the Secretaries of State for Scotland, Wales and Northern Ireland is to handle relations between the central and devolved governments.