Because the terminal runs on the host, but the files are inside the Home Assistant docker container. Here’s a guide on how to reach it with Home Assistant OS.
Anyway, you shouldn’t mess with these files. As soon as you update all changes to these files will be lost anyway when the container is rebuilt.
You won’t be able to install additional software like this in Home Assistant OS. Please take a look here at the different install methods. If you know your linux and python, maybe it’d be better to use Home Assistant Core.