Prophages mediate defense against phage infection through diverse mechanisms