In smooth shading, the vertex normals are interpolated as shown in this profile view diagram :

More details in this video : https://youtu.be/PMgjVJogIbc
Most of the times, we want acute angles or right angles to stay sharp.
To do that, you can either :
- enable Autosmooth and set the minimum angle for smoothing (above that angle the edges will stay sharp) :

Note that Autosmooth only works when Smooth shading is also enabled for the object.
or :
- manually select the edges you want to keep sharp in Edit mode and click on Mesh > Edges > Mark Sharp. They will appear in blue (you still need to have Autosmooth enabled but this time you can keep the angle at 180° so only your selected edges are smoothed) :

here's how it looks :

or :
- add edge loops and bevels at the right places to avoid smoothing artifacts. This usually produces more realistic results, since perfectly sharp angles don't exist in the real world even when the bevel is very tiny. Here I highlighted the results of the beveled edges in pink to show you :

and here's how it looks (the bevel is big here, you can make it smaller) :

compared to no bevel at all and smooth shading on all angles :
