Despite extensive knowledge on phage resistance at bacterium level, the resistance of bacterial communities is still not well-understood. Given its ubiquity, it is essential to understand resistance at the community level. We performed quantitative investigations on the dynamics of phage infection in Klebsiella pneumoniae biofilms. We found that the biofilms quickly developed resistance and resumed growth. Instead of mutations, the resistance was caused by unassembled phage tail fibers released by the phage-lysed bacteria. The tail fibers degraded the bacterial capsule essential for infection and induced spreading of capsule loss in the biofilm, and tuning tail fiber and capsule levels altered the resistance. Latent infections sustained in the biofilm despite resistance, allowing stable phage-bacteria coexistence. Last, we showed that the resistance exposed vulnerabilities in the biofilm. Our findings indicate that phage lysate plays important roles in shaping phage-biofilm interactions and open more dimensions for the rational design of strategies to counter bacteria with phage.