Pasting the output of a command into a file normally means copy, switch window, paste. In Vim the shell comes to the buffer.
:r !date
:r !ls -1
:r !curl -s https://example.com
The manual says the command is executed and its standard output is inserted below the cursor or the specified line. Under the hood Vim stores the output in a temporary file and reads that into the buffer. The command runs the same way :!{cmd} does, and a ! in it is replaced with the previous :! command.
A line number in front picks the spot, so :5r !date inserts below line 5. It is a quick way to add a timestamp to a log note or a directory listing to a README.
Do not confuse it with the file form. :r notes.txt without the bang inserts a file, and :0r notes.txt puts that file above the first line. For the command form I would not assume that the 0 trick works, because the manual only describes it for files.
The caveat is that the command runs with your shell and your rights, and it really executes. Do not paste a command from the internet into :r ! without reading it. It can be undone with u, but undo does not reverse what the command did outside Vim. Output on stderr only ends up in the buffer when the shellredir option includes it.
Further reading: Vim help: insert.txt, :read !
Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more