Rotations are linear transformations, and linear transformations can be represented by matrices. The basic rotations about the X, Y and Z axes are considered well-known (although you can derive them if you want to understand them). "Well-known" in this case means we as game programmers mostly just accept them to be what they are as far as our code is concerned, and write functions that directly produce them for a given angle about a given axes.
To that end,
FRotationMatrix is a
FMatrix subclass that exists to facilitate constructing a matrix that represents a pure rotation with no translation or scale (which are also operations that can be encoded into a matrix).
It is constructed using an
FRotator (in this case, the one from the player controller actor,
Controller), which stores pitch, roll and yaw values. It uses those, ultimately, to construct a rotation matrix.
You could do the same thing yourself; pitch, roll and yaw just represent rotations around the Y, X and Z axes (in Unreal's coordinate system). You can build the three equivalent basic rotation matrices and then concatenate them to arrive at a result equivalent to what
FRotationMatrix is computing.