Client A will contact the SBC and suggest a codec to be used. If the codec is allowed by the SBC then it is used otherwise a 2nd choice is given.
The SBC then calls client B and suggests a codec for the call. What it choose to request first depends on configuration. It may have a preferred list or its first choice may be whatever client A is currently using. Again client B can accept or refuse the suggested depending if the codec is permitted on its list.
Finally if a call is established and both clients are using the same codec then the audio paths are switched so they are directly between each other. Otherwise the SBC has to sit inbetween converting between audio codecs on the fly. This is why its a good idea to use the same codecs.