Basically the motor rating is how much current can you put through the wire used to make coils/electromagnets in the motor above that current the motor will cook. The ESC has a max current it can supply before it cooks. The amount of amps actually delivered from the battery to the motors depends on the ESC itself and how often/how long it opens the gates to the motor from the battery. So say you have a battery that can sustain voltage and deliver 100A for some short period of time and motors that could draw 25A each (100A total) and a ESC that is only rated for 60A, is the esc toast? The answer is it really depends, the amp ratings on all these things depends on the environment really since more amps equals more heat and in a cooler environment that heat can be dissipated more quickly and so a component in flight at speed in cold air can actually do better than sitting at rest on the bench at room temp. Also the battery although rated for 100A may not really sustain that discharge current for very long or may begin to dip in voltage and since resistance in circuit to motors is roughly fixed the drop in voltage while battery is under load corresponds to drop in current. If none of that were true and you had stable 100A current going into the ESC and we're trying to full throttle against a substantial load (large prop or other resistance on the motor, say prop stuck in the ground or on a branch) then could draw the current required to toast the ESC.
Also ultimately the amount of current delivered depends in part on throttle input to the esc it will use more current to attempt to torque the motor around at a higher rate with more throttle applied and will open and close the gates at a higher speed both pulling more power through the ESC and more current going through it is more heat it needs to dissipate.