you ask a question full of innocence.
back in the days before shockwaves were understood and the geometries developed to ameliorate the control problems the development of a shockwave at speed would lock controls, cause controls to cease working or cause them to operate in the opposite sense.
much talented development and experimental work went into understanding the dynamics of shockwaves and developing geometries that made the control problems manageable.
nowadays an aircraft that is expected to operate in a speed range where the problem exists will be designed with all the smarts needed to handle the situation.