Layers are automatically assigned to shapes. However, Visio allows to assign layers to shapes as needed. You can also create your own layers. Let us start by creating a new layer and then assign some shapes to the new layer.
Go to the Layer Properties… dialog box in the Layers dropdown menu from the Editing section of the Home tab and click New… Type a name for the new layer.
The new layer will be created in the Layer Properties dialog box and will initially have zero shapes, as they are yet to be assigned. Click OK.
Shapes can be assigned to any layer. To assign a shape to a layer, click the shape or connector in the diagram and then, click Assign to Layer in the Layers dropdown menu from the Editing section of the Home tab.
It opens the Layer dialog box from which a shape can be assigned to either an existing or a newly created layer.
Note that the New Layer that was created earlier is now in the list. A shape can be assigned to more than one layer as well. To assign a shape to all the layers in the document, click All and then click OK.