By definition, #pH=-log_10[H_3O^+]#. Why should we use such units? Well, back in the day, BEFORE the advent of cheap electronic calculators, scientists, engineers, and accountants used to use sets of printed logarithmic tables for multiplication and division of very large or very small numbers.......

And thus for the product #x xx y#, we could take logs, and get #x xx y=10^(log_10x+log_10y)#, and then take antilogs of this quantity to get the product. Believe it or not, it was easier (and less error prone) to do these sets of operations (which involved standard tables and simple addition and subtraction) than long-handed multiplication. Anyway, I digress again.........

And for your problem, since for #A/B#, #[H_3O^+""_A]/[H_3O^+""_B]=10^3#, as #log_10[H_3O^+""_A]-log_10[H_3O^+""_B]=3#. You need to remember the given definition of #pH#, which can be extended to #pOH# (and #pH+pOH=14#, for aqueous solutions), and also to the equilibrium constant #K_a#, with #pK_a=-log_10K_a#