What a cap is
Maximum supply is the ceiling on the number of coins a chain will ever create. It is part of the consensus rules every full node enforces: blocks that would create more than the rules allow are rejected. That is why a cap on a decentralised chain is more credible than a promise by a company, since changing it would need the network's nodes to agree on new software.
Bitcoin and Litecoin
Bitcoin Core's source defines the constant MAX_MONEY as 21,000,000 times the number of base units in a coin, and uses it to reject any amount beyond that. Litecoin's source defines the same constant as 84,000,000 coins, four times Bitcoin's, matching its faster block time. Both reach their caps by paying a block subsidy that halves at fixed intervals and approaches zero, so the last coins are issued far in the future.
Dogecoin is different
Dogecoin's source shows a different design. After an initial schedule of falling rewards, the subsidy function returns a constant 10,000 coins for every block from six times the halving interval onwards. A constant reward means supply keeps growing without a hard cap, although each year's growth shrinks relative to the total as the supply gets larger. Its code also contains a very large sanity limit on any single amount, which is not a supply cap.
Why it matters
A cap shapes expectations about scarcity, but it does not set a price or guarantee value. What matters is also how fast coins are issued and how many are lost. When you compare coins, check the rule in the source, not a headline number, and look at circulating supply as well as the maximum.
Checking it yourself
The constants are public in each project's repository. A block explorer shows the current supply, and a price page that reads supply from the chain, as Scrypt Price does, lets you compare it with the cap.