As with all things legal, there is a long and complicated answer. Here, I try and simplify things.
If you are buying from a reputable electric bike dealer, selling mainstream bikes you can be pretty sure you will be buying UK legal bikes. However, if you are looking at buying online and something sounds too good to be true, it usually is!
There are four main things to look out for to be sure you are complying with UK law regarding electric bikes; Rider Age, Motor Power, Assisted Speed and Throttle Activation.
The simplest to cover off is rider age. In the UK you need to be at least 14 years old to ride an electric bike in public places. This includes, bridleways, cycletracks and roads, unless they are privately owned in which case you will need the landowners permission. However, there is no restriction on the age of children who may be carried on the bike. For example, A Riese & Müller Packster 40 has fittings for a child carrier and suitable raincover, the Load 75 can carry 3 small children with seat belts and the Tern GSD with the rear club-house attachment is best way for older children to enjoy an electric bike.
Next up is motor power. This is again simple. The motor must not be rated more than 250W, but this does not mean that every bike with 250W will perform the same. If you are a lover of speed and 'power' you need to be looking for a bike firstly with a mid drive motor and secondly with plenty of torque. A great example of this is the Bosch Performance CX motor which can be found across the range of Riese & Müller premium electric bikes. The other way to get up the hills faster is to buy a lighter bike, or my least favourite option, go on a diet. Losing a few pounds, really will make a difference, but hopefully this will go hand in hand with your ownership of an ebike.
Assisted speed is always a hot topic. In the UK the maximum speed the bikes motor can assist you to is 15.5mph which is equivalent to 25kmh. In reality my Bosch motor fades out assistence between 15.5 and 16.9 mph. It easily possible to go faster than this downhill, or on the flat with thinner tyres and more of your own effort, and this is completely legal. In europe there is 45kmh catagory (30mph), but this requires the additional of a licence plate and uses a slightly different Bosch motor. You can buy these bikes in the UK but they are not road legal. Personally, I find 15.5 mph perfectly fine for the riding I do (mainly commuting and leisure riding). If you are a sped freak, you could go for a Moustache Road bike. These are lightweight bikes with smaller motors and batteries but have the benefit of less resistance than a normal electric bike beyond the 15.5 mph limit.
Lastly, throttle activiation on new UK legal electric bikes is a definate no. There was a time in the past when the law was not particulary clear, and through some loophole twist and go bikes were being supplied. These were mostly on the lower end rear hub motor bikes. Bikes with a good quality UK compliant motor from manufactururers like Bosch, will never have throttle assistance. But don't let this put you off. There are power modes in the motor controller called eMTB or Turbo, these provide more than enough power to stop you breaking into a sweat even as you climb the steepest hills, if that's what you wanted.
There are a couple other things to be aware of. There is no limit on battery size, as this only dictates the range you will be able to cover. But remember, the more weight you carry, the slower of the line your bike will be.
Whilst I am an advocate of the cycle helmet, there is no law stating you must wear one when riding a bike. There are loads of really comfortable and fashionable helmets available for relatively little money. You'd wear shoes so you don't hurt you feet, so wear a helmet to protect your head!
And finally, you do not have to have a dedicated insurance policy for your electric bike unlike a car or motorcycle.
If your bike complies with the above and it will if you buy from a reputable electric bike dealer, then you are free to use your ebike anywhere you can use a traditional bike. This means bridleways, cycletracks and all public roads. And it's worth remembering that now the hills won't get in your way, you can travel away from the major roads and take down more climbs and eat up the extra miles :)
Hopefully this outlines why you should go for a UK legal electric bike, but if you are still not convinced, consider this. Buying a bike with more than 250W of power, with a throttle assist or capable of propeling you beyond the 15.5mph limit, means your bicycle will actually be classed as a moped. And in the UK a moped requires DVLA approval or type approval, registration document and plate and road fund license. In addition the rider requires insurance and the the relevant category approved on their license. Maybe ask yourself, would you ride a motorbike without the aforementioned, and what could the consequences be if you you were to casue an accident?