Only owned beds (those currently claimed by a villager) are counted for this purpose. In Bedrock Edition, a village periodically spawns stray cats to fill a quota of 1 cat per 4 owned beds, up to a maximum of 5 cats for 20 or more owned beds. The spawning of cats in villages is a separate process from the natural spawning of passive mobs and thus is not affected by the Creature mob cap. A village cat spawns with a random appearance, although black cats may spawn only during a full moon which works on both Java and Bedrock.
Cats that spawn with the creation of a village do not despawn, however, any additional cats that spawn within a village may despawn. Untamed cats spawn in villages as long as there are at least five claimed beds within 48 blocks and at most four cats within a 97×17×97 box centered around the spawn position. A cat can spawn if that block is less than 2 chunks from a village with fewer than 5 cats, or inside a swamp hut. A random player is selected (including spectators) and a random location is chosen 8-32 blocks away from the player horizontally in both directions and at the same height.
Cats can spawn every 1200 ticks (1 minute).