Ray, unless you have played or researched the topic , that's hardly surprising : they are both brass and make a similar noise !
It's a matter of length and timbre.
The Trumpet is the older, longer instrument, always from the outset associated with horsemen and aristocracy, and used for signalling as early as the Crusades. The last fifth is conical ( the bell ) but the rest of it is cylindrical , which gives the harsher, brighter tone.The length used from 1800 is around six feet, and that enables about ten notes to be played. They had been used in mounted " Fanfares " of about six players since the 16th century, with kettledrums , and were part of early orchestras from the late 1600s.
The Bugle was originally a conical signalling horn , shorter ,with a completely conical tube. There are five usual notes, which have rounder, duller tone.
They were always part of the huntsman/Jaeger tradition mostly from Germany, and associated with Light Infantry rather than cavalry . The first type were in " Halfmoon " shape .
British Light Infantry and Rifles took them up from 1800, using the modern folded format , and the Cavalry realised their utility from about 1830, mostly because they are easier to play.
The shortness of the tube allows more accuracy in finding the right note : they are forgiving where a trumpet is not, especially aboard a moving horse.
So the compromise was reached where cavalry Trumpeters ( NEVER described as Buglers ) carried both instruments, and played the Bugle for signalling when mounted ( easier ) and the Trumpet on foot and for more ceremonial music ( more difficult, but more Splendid ).
Caton Woodville's Trumpeter illustrates the point perfectly : Bugle being sounded, mounted, Trumpet tied up tight on its cords on his back :~
Military instruments in many countries such as the US now combine features of both instruments, being really trumpets with more conical bores, or long Bugles.