What are these pipes
The caped pipe you could hear the toilet flush is the clean out . This the location a snake is put in if the pipes backup. Is the second pipe outside a bathroom or kitchen? If so it may be a second clean out especially if they are quite a distance apart and if it is a clean out it should be capped also. A second possibility for the uncapped pipe is a clean out for the drains to the storm water runoff from your gutters these don't require a cap but it is a good idea so material from the flower bed dosent fill it up.