I believe the code is undoing the current selection (no matter which item – radio button – was selected) and making the new selection active. That action selects the new image. Specifically, the “active” class is being removed from the selected image and being applied to the new selected image.
// Attaches an event handler to fire every time an element matching
// the selector ".color-choose input" is clicked upon.
$('.color-choose input').on('click', function() {
// Assigns the value of the element's data-image attribute to
// a headphonesColor variable
var headphonesColor = $(this).attr('data-image');
// Selects all elements with the class "active" and removes this class
$('.active').removeClass('active');
// Adds the class of active to any elements matching the selector
// '.left-column img[data-image = ' + headphonesColor + ']'
// This will parse to something like '.left-column img[data-image = 'red']'
$('.left-column img[data-image = ' + headphonesColor + ']').addClass('active');
//Adds the class "active to the element which was clicked
$(this).addClass('active');
});