Navy works as a neutral that still has a colour in it. That is why it looks softer than black, and also why it can clash with the darks closest to it.
Navy is dark and low in brightness, so most colours sit on it as they would on black. The blue is still there, and it appears when navy meets another dark colour. Beside charcoal or black, the two read as a near match that did not quite work. Beside anything clearly lighter, the blue simply looks calm.
Brown is the easiest match, because warm leather sits comfortably against the blue. Dark brown is the most formal version, and tan is the most relaxed. Black works in strict business dress. White trainers suit a casual cut, as long as the trouser is not sharply tailored.
Change the level of dress, the weather or the colours you own.
Navy tailored trousers: a supporting piece, so it needs a clear relationship with whatever anchors the outfit.
Colours here are typical dyed-cloth values, not reference swatches, so navy is the greyed navy of a real suit. Your own garment will differ, and so will the same colour in a different fabric.