To put it another way, how did the monarch ensure that the country was in good hands while he was otherwise occupied far away? How did he find someone he could trust? I can't imagine he left them a post-it note saying "Please remember to raise taxes in Epirus xxx".
In England, during the Angevin period, the office of Justiciar was regent of England when the King was abroad and as well as the most important official in the royal administration whether the king was abroad or not. The office of Justiciar was required because the Kings of England held large amounts of land in France - First Normandy then, following Henry II's accession to the throne a huge swathe of western France commonly referred to (somewhat problematically) as the Angevin empire. This necessitated a lieutenant who could run things in England whilst the King was away. Unsurprisingly, this means that the reign of Richard I is the high water mark of the Justiciar's power.
The Justiciarship was, to quote Bates "an enigmatic institution". As I said initially, the Justiciar was essentially in charge of the kingdom whilst he was out of the country; when the King was in the country he was the head of the exchequer. There are a few men often identied as 'proto-Justiciars' during the reigns of the Norman Kings (William I, William II and Henry I): Ranulf Flambard (probably the most famous of this group - Oderic Vitalis actually calls him 'summus justiciarius'), Odo of Bayeux, Archbishop Lanfranc and Roger of Salisbury.
Bates argues that the Norman Kings were the ones to firmly establish the principle that royal authority could be delegated to a single person and that this was a feature of their rule dating from William I's initial conquest of the kingdom. The key difference according to Bates is that the Angevins broke with the Norman tradition of delegating authority to a member of the royal family. West is less ready to call these figures 'proto-Justiciars' though, pointing out that men like Flambard, who seems a clear example on the surface, shared his pre-eminence. He and Bates do agree though that the delegation of power to members of the royal family (West emphasises Henry I's wife Matilda, as well as his son, William) is a key feature distinguishing Norman administration from the later Angevin period. West argues that the Justiciarship "had a number of forerunners, but no lineal ancestors", which is the position I'd be inclined to agree with.
The Angevins (Henry II, Richard I and John) are where we see the rise of the formal office of 'Justiciar'. It wasn't a case of Henry II was crowned and instantly there was an all powerful Justiciar running around - the Justiciar gradually grew in importance throughout his reign (1154-1189) as circumstance dictated, finally becoming the main regent in Henry's absence after his family ceased to be an option in 1173. Of Richard de Luci, one of Henry II's Justiciars West states that "he was regent when Henry II was abroad and the government operated in his name. On the king's behalf he defended the Welsh marches, fortified royal castles and residences, paid the king's servants, arranged for the king's supplies of money and provisions. His activity was scarcely less than that of Henry II himself, although his authority was always limited by the king's will; and his actions, as in the case of the suspension of the forest laws, might be disavowed."
One of the most notable of these Justiciar's was probably Ranulf de Glanville. Glanville was drawn from the lesser nobility, his family being based in East Anglia. Glanville rose up the ranks of the English administration with a long stint as sheriff of Yorkshire. He was also a crusader. Glanville is generally thought to be the author of something called the 'Treatise on the Laws and Customs of the Kingdom of England' and it is remarkable in that it details an entire legal code. It's a snap shot of English law in it's most critical medieval period and it's honestly hard to overstate how important it is. I went into some of what Glanville tells us the other day.
The majority (everything but Gascony) of these of the Angevin possessions in France were lost by John, which led to a decline in the importance of the office Justiciar - with the King now permanently resident in England there was really no need for a Justiciar. It was finally suppressed by Henry III in 1234.
In summary, the office of Justiciar evolved out of a long tradition of royal regency under the Norman kings. The office of Justiciar came into being most formally during the reign of Henry II achieving its fullest importance after 1173 when Henry felt he could no longer trust the royal family. In addition to being regent, the Justiciar was also the key administrative official, being in total control of the exchequer and, as the name suggests, important to the justice system. Of course, the most important point to end this on: It's pronounced jus-ti-car not jus-ti-ci-ar.
Sources:
D. Bates, 'The Origins of the Juscitiarship' in R.A. Brown (ed) Proceedings of the Battle Conference on Anglo-Norman Studies IV, 1981.
F. West, 'The Justiciarship in England, 1066-1232' (1966). Highly recommend this one if you're interested in reading more about the Justiciarship!
J.S. Falls, 'Ranulf de Glanville's Formative Years, 1120-1179', Medieval Studies, 1978.
R. Mortimer, 'The Family of Rannulf de Glanville', Bulletin of the Institute of Historical Research 54, 1981.
W.L. Warren, 'Henry II', 1973. Old, but still authoritative.