Because they're big, sometimes galaxies get close together. Too close. Close enough that their gravity can affect each other, drawing out long arms of gas and stars, distorting each other into weird and beautiful shapes. It happens a lot.
Such is Arp 273, seen here in a Hubble image taken to celebrate the observatory's 20th anniversary in space. These two big galaxies passed each other in the recent past (like, a few million years ago). Both were probably normal enough before the encounter, but are now twisted and asymmetric. Reds and yellows are dust and old stars, and blue is where the recent collision has spurred star formation. And you might think this is a remote event that doesn't affect us at all - and at 300 million light years distant, you're right - but keep in mind that a similar fate awaits us and Andromeda... in a billion years or two.