The bass guitar, or at least the physics behind it, works very similarly to a guitar.
The note that is produced by plucking the string has to do with the frequency. For example, if a string has a frequency of 440 Hz, than that would be an A note. You can change the octave of the note by either doubling the frequency, or cutting it in half. That means that it is still an A if it has a frequency of 220 Hz or 880 Hz.
The frequency of the note is determined by a couple of factors. The main factor is the length of the string. When you press down on a fret, you are shortening the length, and in turn raising the frequency. The 12th fret is always an octave up from the open string because its halfway down the string.
In addition to length, tension plays a role. when you tighten the string you increase the tension and that increases the frequency. The thickness also is a factor, the thicker the string the lower the frequency.
For more, www.bassplaying.com/physics-off-bass