Of course you could build dedicated high speed lines, but then you would engineer them without tight curves. This limits the extent to which tracks can be banked up. If the track is banked too much for really fast trains, then if any train comes to a stop on the curve due to a red signal the slant will cause discomfort to passengers. Also arranging for the overhead pantrograph to make proper contact with a wire above a banked curve is a little tricky. Clearly trains themselves need to tilt, then you get the double benefit of tilted track and tilting train, and the train can tilt to exactly suit the speed it is going at.
Carriages have tilting mechanisms.
Obviously the bogies cannot tilt because they ride on the track and must follow the path of the track. So the coaches have to tilt on the bogies. The way they do this is simple, the bogie acts a fulcrum in the centre and it is free to tilt either side. Then pistons control how much the coach tilts. The pistons are controlled by a small computer, which uses a spirit level.