The idiom originates from the image of well-arranged fields (井田制), where 井 refers to the grid-like field system of ancient China, symbolizing perfect order.
grammar
Typically used as a complement after 得 (de), or as a predicate: 一切都井井有条 (everything is in order).