The quick answer is that Norsemen, Gaulish Celts, Romans (via Egypt to Spain [where some of those nationalities were collected] to Ireland), and the original indigenous peoples make up the ancestry of today's Irish, Scots, and Welsh.
It's kind of a generic answer without a lot of details. There were several waves of migrations that took place around the B.C./A.D. timeline. There are few, if any, reliable record of the indigenous island peoples living in Ireland and Scotland, especially since they intermarried with the newcomers and basically disappeared. The Scots were supposedly named after Scotia, the name of the Egyptian princess who married an exiled caesar's son. They left Egypt and traveled up to Spain looking for a country to call their own. That didn't work out and they set sail for the area we know as Ireland today. Eventually, they spread to the Scotland area, where it is believed that some Norsemen already lived. The Celts were already living in the area.
The Scotians moved back and forth between Ireland and Scotland until they eventually separated into distinct superclans on both islands. Wales was a part of these migrational moves. Ultimately, however, Wales was conquered by the English.
This is a really broad brush approach to the heritage of that area without a lot of details. The history is rich and fascinating and is very well recorded by monks once the celts and the Scotians (later shortened to Scots) conquered the land.