I think what you're seeing here is that when you initially build muscle, you are building new muscle cells. When you lose those gains, you still mostly have the same number of cells, but they muscle fibers in them reduce. When you go to regain it, it's easier to regain because you still have most of the celluar framework there.
Or, at least, that's how it was explained to me. I probably have some details wrong.
I don't know if muscle memory is a scientific term but I understand it as adaptations of muscle and nerves that are skill specific as a result of training. I think it's hard to put a boundary around the brain here. The brain and the nervous system is also a component of strength.
aqueueaqueue probably meant this part ^. If you do steroid once, then you stop doing steroid, its effects remain, according to wiki (in mice).