Can the Scottish Parliament legislate on all matters?

The Scottish Parliament, established in 1999, does have significant law-making powers, but it's not unlimited. Think of it like this: certain key areas are "reserved" for the UK Parliament in Westminster. These reserved matters include things like defence, foreign policy, immigration, and some aspects of social security. So, while the Scottish Parliament can legislate on things like education, healthcare, and some areas of criminal and civil law, it can't make laws that clash with these reserved powers held by the UK Parliament. That's why it's false to say the Scottish Parliament can legislate on *all* matters. It's a system of devolved powers, where some powers are given to Scotland, but ultimate authority on certain issues remains at the UK level. A common misconception is that devolution means complete independence in law-making, but that's not the case.
The Scottish Parliament has powers, but not over everything. Some things are reserved for the UK Parliament.