You're referring to a transformation from a pair of independent variates $(X,Y)$ to the polar representation $(R,\theta)$ (radius and angle), and then looking at the marginal distribution of $\theta$.

I'm going to offer a somewhat intuitive explanation (though a mathematical derivation of the density does essentially what I describe informally).

Note that if you scale the two variables, X and Y by some common scale (e.g. go from U(-1,1) to U(-10,10) or from N(0,1) to N(0,20) on both variables at the same time) that makes no difference to the distribution of the angle (it only affects the scale of the distribution of the radius). So let's just consider the unit cases.

First consider what's going on with the uniform case. Note that the distribution is uniform over the unit square, so that the probability density in a region that's contained within $[-1,1]^2$ is proportional to the area of the region. Specifically, look at the density associated with an element of angle, $d\theta$ near the horizontal (near angle $\theta=0$) and on the diagonal (near angle $\theta=\pi/4$):

[![enter image description here][1]][1]

Clearly the probability element $df_\theta$ (i.e. area) corresponding to an element of angle ($d\theta$) is larger when the angle is near one of the diagonals. Indeed consider inscribing a circle inside the square; the area spanned by a given tiny angle within the circle is constant, and then the part outside the circle (of same width as the square) grows as we approach the diagonal, where it at its maximum. Indeed, we can see that the density must be proportional to the length of the segment from the center of the square to its edge; simple trigonometry is sufficient to derive the density.

This completely accounts for the pattern you see in the simulations.

---

By contrast, if the joint distribution is rationally symmetric about the origin then the probability element at some angle doesn't depend on the angle (this is essentially a tautology!). The bivariate distribution of two independent standard Gaussians is rotationally symmetric about the origin:

[![enter image description here][2]][2]

(code for this image based on Elan Cohen's code [here](http://www.stat.cmu.edu/~kass/KEB/RHTML/R/bivariateNormalPerspectives.r.html) but there's a nice alternative  [here](https://www.otexts.org/1139))

Consequently the area in some angle $d\theta$ is the same for every $\theta$, so the density associated with the angle is uniform on $[0,2\pi)$

  [1]: https://i.sstatic.net/cdvFV.png
  [2]: https://i.sstatic.net/DvAfe.png