I know from the sampling theorem, that the signal frequency $f_{sig}$ shouldn't exceed 0.5 of sampling frequency $f_{samp}$.
I decided to have a look at it and tried for example $f_{samp} = 50 $ $kHz$ and varied the signal frequency as parts of sampling frequency.
For $f_{signal} = 0.1\ f_{samp}$ sampling looks fine:

but if I try $f_{signal} = 0.5\ f_{samp}$ digitizing failed:

$1.$ my first question is why? does $0.5$ the upper limit for signal frequency in the sampling theorem?
Next, I decided to check the effect of aliasing and chose $f_{signal} = 0.51\ f_{samp}$:

$2.$ my second question - why does it happen? I saw some explanations of it, but is not evident (I don't exactly get the physical reason of this effect).