Following example: Create a copy of an existing skeleton mesh (including the armature). Select the armature. Enter edit mode with TAB. Select all bones with A+A. Hit CTRL-R to change the bone roll. Enter 90 to rotate it 90° and hit Enter. You would see a quick bone roll around their own axis but the bones itself would look identical afterwards (even the names are the same of course). If you did not setup some IK poles in Blender and you ask somebody else afterwards if he could see some difference (either bonenames, bonesize, boneshape, pose, size, color, everything) he would not see any difference as long as you don’t enable the view to show him the bone axes.
If you export both meshes now (that look identical are named identical are posed identical, …) and import the first with the skeleton and the second one without the skeleton (but using the already imported one as shared from the first mesh) then … your animations would look terrible messed up. Even if you set all those bones to skeleton in retargetting manager. Even if you started with the same skeleton. Bone names and hierarchy did not change in that example. Even the mesh and the pose was the same. The only thing that get changed: Your first mesh would look left and right if you rotate the head gimbal x and the second one would look straight upwards and downwards using the same gimbal x axis (even if those bones look identical at a first look). Rotations always come from the animation. So if you would skip the step with the “retargetting for a different skeleton” then it seems UE4 is not able to guess how to translate it right. If you use both meshes again but don’t share the skeleton but import both ones and do the “retarget for a different skeleton” instead then the animations would look (almost) identical.