The modern UK Parliament can trace its origins all the way back to two features of Anglo-Saxon government from the 8th to 11th centuries. These are the Witan and the moot.
The Witan was the occasion when the King would call together his leading advisors and nobles to discuss matters affecting the country. It existed only when the King chose and was made up of those individuals whom he particularly summoned.
The Witan's main duty was to advise the King, but its assent was not necessary for the King to take action. Nor did it help frame the laws, as the modern Parliament does, but primarily consented to the laws the King had already decided to enact. However, Anglo-Saxon Kings realised that they could not govern their territories without local support from these powerful men, and so began the delicate balancing act between the King's power and the power of those he governed.
After the Norman Conquest, Kings of England began to govern through a smaller but permanent inner council of advisers and officials, but occasionally the King would call on additional nobles (earls and barons) and churchmen (bishops and abbots) to gain their approval of his decisions, especially regarding taxation.
This larger group of noble advisors especially summoned was known as the Great Council (magnum concilium) and it formed the basis for the modern Upper House of Parliament - today the House of Lords.
Also, under the Anglo-Saxons there had been regular meetings, or moots, for each county (or shire) where cases were heard and local matters discussed. The 'shire moot' was attended by the local lords and bishops, the sheriff, and most importantly, four representatives of each village. After the Conquest, this meeting became known as the County Court and it introduced the idea of representative government at the local level.
These two gatherings remained separate for many centuries, but eventually the noble councillors of the Great Council and the local spokesmen of the County Court would combine to make a Parliament of two Houses, the aristocratic Lords and the locally representative Commons.