Question: I am converting numbers between different bases without issues, but I'm struggling to understand the **why** the method I'm using works.

If I convert $A5$ (base 16) to base 8, I would do the following:

> 
> Turn $A5$ into binary (4 bits)
> 
> 
> $A = 1010$
> 
> 
> $5 = 0101$
> 
> 
> $10100101$ (split into three bits) $= 010$ $100$ $101$
> 
> 
> $010$ = 2
> 
> 
> $100$ = 4
> 
> 
> $101$ = 5
> 
> 
> $A5$ (base 16) $= 245$ (base 8)
> 
> 
> 

I know the answer is correct, but I don't understand why the binary is split into $X$ bits depending on the base, and how the value $X$ is chosen. If it's base 4, for example, how many bits should the binary be separated into when converting?

Answer: 
This approach only works for bases that are powers of $2$. So, for base $2^k$ you convert to binary by concatenating strings of $k$ bits, one for each base-$2^k$ digit. In the other direction, you convert from base $2$ to base $2^k$ by dividing the binary digits in groups of $k$ (and possibly padding with leading $0$s to get a number of binary digits that is a multiple of $k$).

The explanation is simple once you think that the number represented by a binary numeral $b\_{n-1}\cdots b\_1 b\_0$ is

$$ \sum\_{0 \leq i <n} b\_i 2^i \enspace. $$

If, without loss of generality because of the padding, we assume that $n$ is a multiple of $k$, we can rewrite the summation as

$$ \sum\_{0 \leq i < n/k} \Big( \sum\_{0 \leq j < k} b\_{ik+j} 2^j \Big) (2^k)^i \enspace. $$

Each summation in parentheses is a base-$2^k$ digit.
This approach only works when the base is a power of $2$. In that case you use $n$ bits when the base is $2^n$. In base $16=2^4$ you use four bits. There are $2^n$ binary strings of length $n$. In base $4=2^2$ you use $2$ bits.