In inelastic collisions, momentum is conserved during the instant of contact between colliding objects, despite energy losses due to friction, heat, and sound. The conservation of momentum applies because internal forces between the objects cancel each other out, while external forces, such as gravity, do not affect the horizontal momentum of the system. In the case of a ballistic pendulum, momentum is conserved during the collision of the bullet and block, and energy conservation applies afterward as they move together. The energy losses during the collision do not impact the momentum calculation at the moment of contact, as the system can be treated as a whole. Understanding these principles clarifies why momentum remains conserved even amidst energy transformations.