They both try to achieve the same purpose, i.e. tell you how to go from A to B.

The first task they do is try to follow roads or paths to connect A to B, and then they calculate the expected time by crossing the length of each road with the expected travel speed on it.

But there is plenty of data in OSM that can change this.  We map traffic signals: a smart algorithm should count them and calculate a time penalty.  Same goes for stop signs.  If you ride a bicycle, you might prefer a slightly longer trip to avoid a street with bad stones.  Or you may ride slower if it goes uphill.  Crossing railway or tram tracks might be considered inconvenient.  As for cars, if the speed limit is 50 on a large boulevard, one can assume people will drive with that speed, but if it is 30 in a small residential road, a well-thought algorithm should assume people will not drive exactly on the speed limit but much slower.  And so on.

OSRM seems quite "basic": it takes the shortest route that works.
GraphHopper seems to take more parameters, especially for bicycle routing.  It gives somewhat longer routes but they seem more realistic.

Hope this helps.

(Maybe this question should be asked on the forum, notes are here to report mistakes or missing data.)