Well DQ, you basically got it all!
The filter and often the gravel in an aquarium will house the beneficial bacterial (that's why it's usually best you don't clean your gravel unless absolutely necessary!). A filter is best because it kinda pushes the water around :) but you have to be careful because betta fish don't like currents very much...
This beneficial bacteria breaks the ammonia (poisonous to fish in high concentrations.) down into nitrite (even more deadly than ammonia) and than to nitrate (harmless, but in high concentrations can stress fish out and promotes the growth of algae, hence why water changes are still very important).
Because I'm lazy, I use Nutrafin Cycle to cycle my tank =v= it adds beneficial bacteria straight to your tank without you having to wait for the tank to naturally establish the bacteria. I usually add straight to my filter while I'm waiting for my tank to reach the right temperature and than wait a few hours before I put my fish in just as a safety precaution (I just like to make sure all the water has been treated). But Nutratfin Cycle claims that it instantaneously cycles your tank allowing immediate introduction.
Ahaha, =v=;; I was just thinking how whenever I try and float a cup in my tank to make sure the water temperatures match before I put my fish back into their home, they always jump out like 30 seconds later >.<;;.