We do it the same way we do any other seemingly-impossibly-large task - we break it down into smaller and smaller tasks until they are small enough to do. Cards in Master Duel are not atomic - they can be broken down into smaller components like card type, costs required to play that card, effects that happen that card is played, restrictions on when the card may be played, and so on.
It helps if you reframe what you think of as a “card” as, instead, a collection of individual costs, effects, and data. Everything first hinges on the card’s type - monster, magic, trap, ritual, synchro, fusion, etc. For each card type, there’s a batch of type-specific data - monsters have a star level, attack power, defense power, subtype(s), element type, and possible effects (e.g. flip effect, tribute effect, when dealing damage to a player effect, when attacking effect, etc.). The same sort of type-specific data exists for magic cards, traps, synchros, and so on.
Imagine I create an effect - special summon a monster from your graveyard in attack position. This same effect could be used to create more than one card, e.g. both Call of the Haunted and Premature Burial would use this effect. Each of these cards has additional effects and costs beyond this - Premature Burial has a cost of paying 800 life points and equipping the monster, and both require the monster to go back to the graveyard if the card with the effect is destroyed. With enough different costs and effects, I can then combine them in different variations to create a large number of different cards.
Cards are just combinations of attributes, costs, and effects. As long as we have enough of each of these, we can create as many cards as there are combinations. We can increase the pool of possible cards by adding new types of effects, new costs, and new card attributes. The things we build aren’t just new cards, but also new design space for possible cards. That’s how we get the cards functioning properly.
Got a burning question you want answered?