One of the odder sound changes in the development of Romanian from
Latin is the sound change /kt/ > /pt/, /ks/ > /ps/, /Nn/ > /mn/,
orthographically "ct" > "pt", "x" > "ps", "gn" > "mn".

What is the process behind this sound change? What are the
possibilities?

If it is a substrate effect, it is conceivable that they were
perceived as clusters ending /t/, /s/ and /n/, and that the
substrate language only had one cluster (other than geminates) of
each type, namely a cluster starting with a labial.

What are the internally generated possibilities?

A wild possibility is /kt/ > /xt/ > /ft/ > /pt/. I am not sure
about the plausibility of the last step, though I am not aware of
any -ft- clusters in Latin, and Proto-Slavic certainly lacked them.
A similar process would then be plausible for /ks/ > /ps/. This
theory does not explain /Nn/ > /mn/. It could be that the merger
simply resulted from the low yield of the contrast. /N/ and /m/
certainly have an affinity - c.f. the varying resolutions of
Sanskrit anusvara as /m/ and /N/ in modern traditions of
pronunciation.

Richard.