The latencies are typically quoted as round trip through the matching engine. This does not include transit latency to the matching engine but will include any internal transit latency once the matching engine has the order. So you can assume it is from when the order message reaches the network interface on the order processor to when the response leaves the network interface towards the market participant.
The amount of work the matching engine has to do is non-trivial but straightforward. Take order, look at type, if market order look for a match on the limit order book, if not handle appropriately (this bit is not included in the latency as it might involve routing to other venues, etc). If it is a limit order it must find the right place to position that order within the order book. Building an order book data structure that is cache friendly and thus very fast is not rocket science but it certainly isn't easy.