When the Normans invaded the British mainland in 1066 they were only able to conquer the area that is today known as England. For a long period Wales, Scotland and Ireland retained their independence from the Normans.
At the time of the Norman invasion, Wales was a collection of small kingdoms. Knights who had land in England were encouraged by the Norman kings to expand into Wales. These knights, who became known as marcher lords, tried to do this, but the mountainous territory and the fighting abilities of the Welsh made it difficult.
While the marcher lords won land in the east and south, other parts of Wales remained under the control of Welsh princes. In 1183 Richard, 6th Earl de Clare, obtained control of Glamorgan, the largest and the most important marcher lordship in Wales.
Richard de Clare died in 1217 and the family estates were passed on to his son Gilbert, 7th Earl de Clare. The Welsh chieftains in the area refused to accept Gilbert as their overlord. To help establish control, Gilbert imported tenants from his English manors. The Welsh, led by Morgan Gam of Afan, responded by carrying out numerous raids on Clare's tenant farmers.
In 1228, Gilbert de Clare arrived in Glamorgan with a large number of knights from his English manors. Later that year Gilbert's knights managed to capture Morgan Gam of Afan. Morgan was taken to England and imprisoned in Clare Castle.
Morgan Gam's cousin, Hywel ap Maredudd, became the new leader of the Welsh and the attacks on the Norman settlements in Glamorgan continued. In 1229 Morgan obtained his freedom after negotiating a peace settlement with Gilbert de Clare.
After Gilbert de Clare's death in 1230, Morgan Gam resumed his military campaign against the English in Glamorgan. Gilbert's eldest son, Richard was eight years old when his father died. It was not until he reached the age of 21 that he began to take an interest in Wales. Richard de Clare and his knights arrived in Wales in 1243. Richard's military campaign was very successful and he was able to expand the territory he controlled in Wales. By 1245 Richard also held the lordships of Llanbleddian, Talyfan and Rhuthin. To maintain control over the area he built a new castle at Llantrisant. The following year, he added Usk and Caerleon to his territory in Wales.
When Richard died in 1262, his son Gilbert the Red was an inexperienced nineteen year old. Welsh chieftains led by Gruffydd ap Rhys, took this opportunity to try and win back Glamorgan from the Clare family. Gilbert captured Gruffydd in 1266 and imprisoned him in Cardiff. Later, Gilbert had him transported to Ireland where he was kept at Clare Castle in Kilkenny.
In 1270 Gilbert the Red agreed to accompany Henry III on a crusade to secure Christian control over the holy places in Palestine. Just before he was due to leave for the Holy Land, Gilbert heard news that Llywelyn ap Gruffydd had seized and destroyed his castle at Caerphilly Castle. Instead of going to the Holy Land, Gilbert the Red took his knights to Wales. After he won back Caerphilly, Gilbert decided to build a massive stone fortress that would be impossible to capture. When Caerphilly Castle was completed in 1272 it was considered to be the strongest castle in Britain.