Why do I see black bars at the sides of my screen while screen mirroring?

This is a letterboxing adjustment that is normal and automatic

Screens come in a wide variety of sizes, and while we love all of them, they do not always fit perfectly within each other. When this happens, it is typically because one of your screens is sized or shaped differently than the other. Most often, one screen is wider. The dimensions of the source content and destination screen do not align.

Ditto scales your mirrored screens to fit the display as perfectly as possible without stretching or distorting your image to fit a destination screen. The difference in aspect ratio between your screens will be shown in the form of some black space, typically at the sides or above and below the mirrored image. This happens due to the physical difference in shape from one device screen to another.

For example, many Mac computers will use a 16:10 physical display while the standard television is 16:9. This physical difference often accounts for a tiny amount of black spacing on the TV when mirroring these models, and there is not an adjustment option to remove the black spacing.