As you know, Marx stated that society must go through a transitional socialist period of development before full communism can be accomplished. At this point he states that society would be stateless. I certainly can understand why much of the state would wither away, such as a simple algorithm for a guaranteed minimum income being implemented to replace much of the bureaucracy of individual welfare programs. Marxism seems very practical in its critique of capitalism and proposed solutions. But, I am struggling to envision the concept of a stateless society actually being accomplished. Won't institutions such as basic law-making bodies and police always be necessary in the form of a state, and perhaps we just take the approach of minimizing their ill effects with democratic safeguards? Or was Marx's definition of 'stateless' different from the modern common understanding of the word?
Marx did not write much on these topics, so a sense of his meaning needs to be constructed from his fragmentary comments. This adds to the variety of possible interpretations.
Mine is this: for Marx the state has usually been the instrument of the ruling class to operate, manage, consolidate the rule of one class over another: masters over slaves, feudal lords over serfs, and employers over employees in capitalism. Once class differences are genuinely overcome - that is, the people producing surpluses by their labor are likewise the same people who receive and decide what to do with those surpluses - then a state apparatus to enforce class differences ceases to be needed socially and "withers away." However, other functions of states - for example, to adjudicate disputes, make laws and rules, etc. might well remain if and to the extent that what Marx called classless societies (communist) wanted them.