Layout thrashing is what happens when a forced reflow is repeated over and over in quick succession. The code writes to the page, reads a layout measurement, writes again, reads again, and so on. Each read after a write makes the browser throw away its plan to batch the work and recalculate layout on the spot.
It usually hides inside a loop. Imagine a script that goes through a list of 200 items. For each one, it reads the item's width and then sets its height based on that width. Every read follows a write from the previous round, so the browser recalculates layout 200 times. The same work, arranged as one pass that reads all 200 widths and a second pass that sets all 200 heights, needs only one layout calculation.
It matters because the cost multiplies. A single reflow might take a millisecond; hundreds of them can freeze the page for a noticeable moment. During that time the browser cannot respond to taps or clicks, so thrashing is a common cause of laggy scrolling, slow menus and sluggish interactions, which feeds into Core Web Vitals such as responsiveness.
The common mistake is treating each line of code as innocent on its own. Nothing looks wrong when you read it, because the damage comes from the order of reads and writes. Performance profiles in browser developer tools usually flag it with warnings about forced layout.
The standard fixes are to separate reading from writing, to batch changes together, and to let the browser schedule updates with a frame callback instead of measuring mid-change.
Related: Forced Reflow, Core Web Vitals