I'll start with saying that you're right, eventually brute force would crack any encryption scheme. The eventually could be millions of years in the future though, depending on the complexity of the encryption key, the strength of the encryption, etc. There are actually a few defenses against offline attempts to crack a password file that are generally considered best practices.
Since you say you are not clear on how passwords and hashing works, I will give a brief outline of this which also applies to encrypting data in general. I'm sure you've heard people mention cleartext passwords being a problem. The solution to that is using a hashing algorithm.
There are three key parts to any password hashing algorithm. It should always result in the same hash with the same text being produced. It should be computationally expensive to calculate. It should be 1 way or you would have the same problem as the cleartext password list. Once hashing started to become popular, attackers quickly adapted. They would generate hashes of commonly used passwords, known as rainbow tables and then just match these hashes to hashes in the database. This is much less computationally expensive than calculating each hash on the fly, as these hashing algorithms are deliberately slow.
The assumption you have to make is that your password database may eventually be stolen by an attacker.and the longer it takes for them to crack it, the more likely you can detect their attack and reset your credentials. This is also a reason why 90 days is recommended for password rotation, since it reduces a window during which those credentials are usable. Anyway, I'm going to outline the basics of these defenses so you can continue your learning on this topic and bold specific words that are of specific interest.
First of all, any password database encryption scheme should include a salt. An example of a password encryption scheme that includes a salt is bcrypt, which is a good baseline of what to look for with anything performing this function. A salt is generated for each password and helps prevent an attack using rainbow tables. Rainbow tables use a list of precomputed hashes, and a salt makes this impractical to store on disk because of the sheer size requirements.
There are also ways you can make it make it hard to calculate each hash. This causes each lookup to be slower, but it's still fast enough it doesn't bother users. It just makes a brute force attack much slower. bcrypt again is a good example of this.
The third one is the most commonly known defense, password best practices. It seems fairly mundane, but it can help ensure that any attacks based on using common password dictionaries will fail and that much, much slower bruce force techniques need to be used.