It's largely a geometry problem. You start out with any number of roughly equidistant points on a sphere representing samples of the crust. You can see these points at any time in pyTectonics by setting map type to "Debug".
Points can be arranged in any way so long as they're equidistant. Here, we use something called a [Fibonacci Grid] because they're good at arranging any number of equidistant points, but that's an aside.
The points are divided up by plates. Several coordinates are selected randomly and points closest to those coordinates are lumped into a plate. Plates are randomly assigned a speed and what's known as an [euler pole]. Every plate in real life has these. From there on, plate motion is simulated in timesteps of given length.
Points that overlap represent subduction - the denser of the two sinks below the other, just like in real life. This is not quite the crust's end, though. Subducted crust plays an important role in mountain building. Subducted points remain in the model, just typically out of sight from the user. These points are shown in red when in the Debug view.
A subducted point continues to move for a predefined distance until its said to detach from the lithosphere. In short, the point is destroyed from memory. The predefined distance a point travels before destruction effectively describes the width of mountains on a planet. I've wanted to incorporate models to describe this distance mechanistically, but all research I've read so far suggest this would require adding way more parameters that could not go on to be used elsewhere, and I do want to keep this thing parsimonious.
As opposed to overlaps, gaps forming between points represent rifting. Here, a new point is formed that represents ocean crust. Each plate stores its points in a grid matching the planet's original configuration, and points are added to this grid - this way, points don't start looking messy as time progresses.
Other submodels play a lesser role in controlling elevation. Isostasy is perhaps the most important, since its responsible for most mountains. Each point tracks thickness and density, and when points overlap their thicknesses/densities are considered together to determine elevation. There is also a submodel controlling crust added to volcanic arcs. Basically, when subducted points are destroyed, a certain amount of crust is added to the points that overlap them.