Why do some selected objects have a yellow outline and others have an orange outline?
3D Viewport:
One way to select objects is clicking on them in the 3D Viewport in Object Mode.
Objects with an orange outline are sleceted, but the one object with a yellow outline is the active object. There can only be one object with a yellow outline (but there can be multiple with an orange outline). When holding Shift down (that is the default key), you can select multiple objects. The object you select last is the yellow and active object. This is important if you want to do operations on multiple selected objects.
For instance, if you select two cube objects in Object Mode, &quot;Cube&quot; and &quot;Cube.001&quot; in that order, and then press Ctrl + J, then &quot;Cube&quot; will become part of &quot;Cube.001&quot;. Since &quot;Cube.001&quot; was the active object. &quot;Cube&quot; will be gone and the &quot;Cube.001&quot; object will have a mesh consisting of two cubes.
If you select two cube objects, then select a sphere object and then de-select the sphere object, you are left with two cubes with an orange outline. Now joining the objects with Ctrl + J will not work, because Blender does not know which object to make part of the other and which one to keep as the remaining object.
Also, if you add geometry in Edit Mode, for instance add a cube to a cube and then select it in Object mode, both cubes have a yellow outline. It may seem you have two objects with the same color outline, but it is one object. So not a new object was added, but geometry was added to the mesh of the object, and in Object Mode the cubes will move as one.
(If you have multiple meshes in one object, but you want to separate them into multiple objects, you can select the object in Edit Mode an press P and choose for instance By Loose Parts.)
EDIT:
Outliner:
If you select objects in the Outliner window however, it can be different.
In the Outliner there is a square with rounded edges around the active object. There is always an active object. So there is always such a square somewhere in the Outliner, even if no object is selected.
If you select an object in the Outliner by clicking on it, it turns yellow in the Outliner and it gets a yellow outline in the 3D Viewport. Shift select other objects and they will turn orange and have an orange outline. So in the Outliner the first selected object is, and remains (while selecting in the Outliner), the active object.
If you select an object in the Outliner, other than the active object (whether the active object is selected or not), by right clicking on it and choosing Select from the menu, it will turn orange in the Outliner and have an orange outline in the 3D Viewport. So if the active object is not selected, you can select multiple objects this way without any of them being yellow or having a yellow outline.
If you select an object and then go into Edit Mode, you cannot select other objects (or their corresponding meshes) in the 3D Viewport. You can select other objects in the Outliner, but in this case the object you are editing is and remains the active object. Also the meshes of subsequently selected objects do not become editable, even though it is possible to edit the meshes of multiple objects at the same time. In order to do this you will have to select multiple objects before going into edit mode.
EDIT 2:
Outdated graphic card drivers:
It is also possible you select a single object and the outline is orange (even though it should be yellow). And when you try to move it, only the origin (the small dot) is affected. Also the origin can be moved away form cameras and lights. This should not happen and is likely caused the 3D Viewport not updating. Updating you video card drivers should resolve this issue.