Why is a plane escorted while in technical difficulties?
It's not a common thing, as aircraft have technical problems every day without a jet escort. Generally only extraordinary circumstances would merit it. 

In this case, the pilots were struggling with an uncontrollable aircraft as well as difficulty navigating - there was lots of bad weather about, and they repeatedly asked for directions to the ocean to ditch, indicating that they didn't know where west was. The jets were scrambled and were available to help the pilots navigate through the bad weather and towards a safe airfield (I don't know if the navigation systems were malfunctioning or if the crew were just understandably overloaded). Fortunately the pilots were able to get the aircraft under some control, I think before the jets even did anything (but more information might come out soon). 

Fighter jets can also help check for damage - being better trained and more maneuverable that a civilian craft allows a closer inspection. An underrated benefit is by just being up there with them, panicked pilots can calm down and focus on the task at hand. 

Finally there is the horrible option of shooting the jet down if it has been hijacked. This would absolutely be a last resort though, and it's possible that these fighters weren't even carrying weapons.