Breeding has a role in temperament. A thoroughbred is on average more highly strung than a lot of other breeds, for example. But there are always exceptions.
Cart horses/heavy breeds bred for driving are built differently to riding horses. They have different proportions. Very, very approximately, they are proportioned for high torque low speed. And they are broader in build, which makes them difficult to ride- the width can cause hip problems in smaller people. A narrower riding horse means a rider can get their leg further round, making the rider more secure and making it easier to communicate with the horse, control its speed, and steer it (this is done by leg movements more than reins, in fact). Horses bred to plough tend to walk with their feet more in a line as they have to cope with walking in furrows, that's not ideal for a riding horse as it goes much faster and is less stable on fast bends.
Heavy horses (plough, draught, etc.) tend when deliberately misbehaving to stop and refuse to go forward (called 'jibbing'). Lighter breeds tend to take off, rear, or buck.
Some ponies (horses below a certain height) are built like smaller versions of cart horses, can carry a lot of weight, and and were used for pack horses/pit ponies etc. Others are built more like riding horses.
Training has a role in behavior, as does rider skill. But the best horse in the world can still, though of course rarely, play up if it is suddenly surprised, and riders do try to be prepared for this. Cyclists should make the effort to understand and allow for it, just as we expect drivers to allow for us suddenly having to move out if there is a pothole, even though cars don't need to.
I linked to this in another thread, please do read it if you haven't already.
http://www.bhs.org.uk/~/media/BHS/Files ... aflet.ashx It urges politeness and consideration on riders as well as us if you read the whole thing, and tries to explain things to those who don't know horses.
And thank you to all cyclists who try to give horses space. It is appreciated, though it may not always be safe to take a hand off the reins to thank you. Riders may nod instead...that's the convention for thanks when riding with other riders.