Direct numerical simulations are used to study the interaction of a cavity-backed circular orifice with grazing laminar and turbulent boundary layers and incident sound waves. The flow conditions and geometry are representative of single degree-of-freedom acoustic liners applied in the inlet and exhaust ducts of aircraft engines and are the same as those from experiments conducted at NASA Langley. The simulations identify the fluid mechanics of how the sound field and state of the grazing boundary layer impact the in-orifice flow and suggest a simple flow analogy that enables scaling estimates. From the scaling estimates the simulations are then used to develop reduced-order models for the in-orifice flow and a time-domain impedance model is constructed. The liner is found to increase drag at all conditions studied by an amount that increases with the incident sound pressure amplitude.