What defines matching topology? In a previous question it was shown that a mesh that was duplicated and deformed separately can be used to define a shape key in the original mesh. If the vertex count doesn't match then you get an error message saying "Selected meshes must have equal number of vertices".

As a test I subdivided a cube and merged some vertices to get a vertex count of 507 to match the count in a default suzanne mesh. After joining as a shape key I see a small resemblance to the suzanne shape but really have nothing more than a collection of randomly joined vertices.



So what defines a matching topology in the context of using a mesh to generate a shape key?
Several things matter:


The vertex count must be the same. = (v0...v19)
The edge list must have the same vertex indices to build each edge. That is, the same vertices must be connected. = [[v0,v1],...[v10,v11],[v18,v19]]
The polygon list must have the same vertex indices to build each face. That is, each face must be formed by the same vertices, in the same order. = [[v14,v15,v7,v4],...[v7,v6,v18,v19]]


Basically, you can move the vertices all you like, but you can't change how they connect.

Here is an image to demonstrate a deformation: