How do you know what each element maps to in a semi direct product I have this example in my lecture notes

"Calculate the semid direct product, $H \rtimes Q$ where, where $H = C_7, Q = C_3, C_7 = \langle b | b^7 = 1 \rangle$."
$Aut(C_7 \cong C_6$. Find all homomorphisms $\theta: C_3 \rightarrow C_6$ (except for the trivial one). We need all elements of order 3 in $C_6$. We have $2 = \varphi(3): \alpha^2$ and $\alpha ^4$.
$$Aut(C_7) = \langle \alpha | \alpha^6 = 1 \rangle$$
  $$\alpha : b \mapsto b^3$$
Two types on non-commmutative SDP:
$$C_3 = \langle a|a^3 = 1\rangle \hspace{1cm} \theta(\alpha) = \alpha^2 \hspace{1cm} \theta(\alpha) = \alpha^4$$
$$ba = a \theta(a^{-1})(b) = a \alpha^2(b) = a \alpha^4(b)$$
$ba = ab^4$ (because $3^4 \equiv4 \mod 7$) 
$\theta(a) = \alpha^4$
$ba =  a \theta(a^{-1})(b) = a \alpha^{-4}(b) = \alpha^2(b)$
$ba = ab^2$ (because $3^2 \equiv 2 \mod 7).$

Here's what I don't understand:
1) How do you know you map $\alpha: b \mapsto b^3$?
2) What does all the $ba = a\theta(a^{-1}(b)$ bit all mean?
Please could someone explain this? Thank you
EDIT: I found something in my notes saying "We need to specify some $\theta(a) \in Aut(C_n), \{C_n \rightarrow C_n\}, b \mapsto b^l, (l,n) = 1$". So we basically want to find some $l$ where the gcd$(l,n) = 1$. I.e $(l,7) = 1$. Clearly $(3, 7) = 1$ but why not $(5, 7)$, or is that because this $l$ must be the number of possible orders in our other group?

The first step to answering your question is going to be understanding what a semidirect product actually is. A semidirect product $K\rtimes C$ can be defined in the following way.
Take elements of $K\times C$ (as sets; the cartesian product); these will be the elements of your group.  Now pick some homomorphism $\theta:C\rightarrow \text{Aut}(K)$ and write $\theta(c)=\theta_c$.  Define multiplication by $$(k_1,c_1)(k_2,c_2)=(k_1\theta_{c_2}(k_2),c_1c_2).$$
What you've got here is written $K\rtimes_\theta C$.  Sometimes when people write a semidirect product they leave the $\theta$ out (when they believe it's obvious which $\theta$ they're using) but it is important to understand that there are many different semidirect products between two different groups, depending on which $\theta$ you pick.
For a description of the semidirect product notation used in your lecture notes (writing the elements individually, like $k$ instead of $(k,1)$) take a look at this pdf.
Now that you've got this, you can manipulate expressions like they want you to.  All they are doing is showing you how the two different (nontrivial) semidirect products work formed by the two different different (nontrivial) homomorphisms $C_3\rightarrow C_6\cong \text{Aut}(C_7)$.  They are manipulating the expressions according to the rules of semidirect products to show you how the $\theta$ gives you the group presentations.
