How do OTB games end up in databases? How do games of players that are not so well known, or not huge events end up in Chessbase and other databases? What are the different ways that games are cataloged? 

If they are not playing on an electronic board in a televised event, are carbon copies being deposited in a box and someone is inputting all the moves? I have played in tournaments with many lesser known GMs and IMs but it hasn't appeared to be any obvious mechanism for how games might end up in one of the databases.
Here is a link to the FIDE record for a norm tournament where I was the chief arbiter. Two or three lines up from the bottom it says "PGN file" and next to it is a brownish icon. If you click on it you can see a list of all the games with the possibility to play through them in a PGN viewer or to download them.

Here is a link to a low level (Minor) tournament I played in a few weeks ago. Towards the bottom of the header it says "Games: There are 59 games available for download". Clicking on the link gives you options to download games by round or to download all the entered games for the tournament.

These games have been entered and uploaded by arbiters and their assistants (cue for you to say "Thank you, arbiters!"). Some of this work (norm events) is done because it is a FIDE requirement. Some of it (like the low level tournament I played in) is done out of the goodness of the arbiters' hearts.

Generally speaking if you enter a tournament and the scoresheets provided are single copy then your game won't end up in an online database and if it is a two-copy scoresheet then it will. The two-copy scoresheets cost more and a tournament organiser would not waste money on them unless the games were to be recorded and uploaded.

People who run websites that include all the games they can find have written bots which crawl the web (or at least select parts of it) looking for PGNs which they download and add to their collection for their website or database.