The original reference for this is the paper of Bruhat-Tits (available on NUMDAM), see Prop. 4.4.3. Another reference, probably easier to read, is the book of Macdonald, "Spherical functions on a group of p-adic type", Theorem 2.6.11.
There is a nice proof of this fact using the geometry of buildings, which goes as follows. You can think only about trees (eg for G=SL(2)) to get the main ideas.
Consider the affine building X associated to G(K). The buildings at infinity of X (which is also the space of flags) can be seen as equivalence classes of sectors in X. Then U(K) is the union of fixators of sectors in such a class \xi. The group T(K) is the group of translation in some apartment A, and B:=T(K)U(K) is the stabiliser of the equivalence class of sector. G(O) is the stabiliser of some vertex o.
The main point is that the building is the union of all apartments containing a sector pointing towards \xi. It follows that, for every x in X, there is an element u of U(K) such that u.x is in A.
Let g in G. Applying this to the element x=g.o, we see that the vertex ug.o is in A. By transitivity of the action of T(K) on vertices of A, there is an element t in T such that tug.o=o. Thus tug is in G(O), which gives the decomposition of g.
You can obtain the $G=KAK$ decomposition from a decomposition of the type $F=UR$. To avoid unnecessary complications, let's assume that our reductive group $G$ is a selfadjoint subgroup of $\operatorname{GL}(n,\mathbb{R})$. Then the map $g \mapsto g^{-t}$ is an involution of $G$, which is called the Cartan involution and is typically denoted by $\theta$. The first observation to make is that the fixed-point set $K = \{ g \in G \colon \theta(g)=g \}$ of $\theta$ is a maximal compact subgroup of $G$. For example, if $G=\operatorname{GL}(n,\mathbb{R})$, then $K=\operatorname{O}(n)$.
Next we observe that $\theta$ induces an involution (also denoted by $\theta$) at the Lie algebra level: explicitly, this is the map $X \mapsto -X^t$. If $\mathfrak{p}$ denotes the $-1$-eigenspace of this latter involution, then one has the following result.
The map $K \times \mathfrak{p} \to G$ given by $(k, X) \mapsto k e^X$ is a diffeomorphism.
In particular, every $g \in G$ can be expressed as $k e^X$ for some $k \in K$ and $X \in \mathfrak{p}$. This decomposition is known as the Cartan decomposition; it is a generalization of the polar decomposition to $G$ (and is, I presume, the $F=UR$ decomposition stated in the OP). Indeed, if $G = \operatorname{GL}(n,\mathbb{R})$, then $\mathfrak{p}$ is just the set of symmetric matrices, and thus the set $\exp \mathfrak{p}$ consists of symmetric, positive semidefinite matrices.
Now let $\mathfrak{a}$ denote a maximal abelian subspace of $\mathfrak{p}$. Then it can be shown that $A = \exp \mathfrak{a}$ is a closed abelian subgroup of $G$ with Lie algebra $\mathfrak{a}$. It can also be shown that $\mathfrak{a}$ is unique up to conjugacy via an element of $K$. That is to say, if $\mathfrak{a}'$ is another maximal abelian subspace of $\mathfrak{p}$, then there is a $k \in K$ such that $\text{Ad}(k) \mathfrak{a} = \mathfrak{a}'$. With this information we can obtain the decomposition $G=KAK$: given $g \in G$, one observes that $p=gg^t \in \exp \mathfrak{p}$, say $p=e^X$. Thus there is a $k \in K$ such that $\text{Ad}(k)X \in \mathfrak{a}$, and then $e^{-\text{Ad}(k)X/2}kg \in K$ (because it is fixed by $\theta$), whence $g \in KAK$.
This hopefully alleviates your 3-terms-vs-2-terms issue.
I'm not aware of any relationship between the Iwasawa decomposition and the $KAK$ (polar) decomposition.
Best Answer
You have a proof which uses the fact that maximal compact open subgroups correspond to vertices in the building of ${\rm GL}(n)$. For instance for the Cartan decomposition you want to classify the orbits of $K={\rm GL}(n,{\mathfrak o}_F)$ (${\mathfrak o}_F$ denotes the ring of integers of your p-adic field $F$) in the vertex set of the building. To the aim, you first use the fact that $K$ acts transitively on the apartments containing the vertex fixed by $K$. This way you may send any pair of vertices $(s,t)$ in a fixed apartment $A$. The stabilizer of $s$ acts transitively on the Weyl chambers and you may assume that $t$ lies in a fixed Weyl chamber. From this it's easy to prove that $$ t={\rm Diag}(\varpi_F^{k_1},...,\varpi_F^{k_n}).s $$ where e.g. $k_1 \geq k_2 \geq ...\geq k_n$ and where $\varpi_F$ is a uniformizer of $F$.
Similarly the Iwasawa decomposition $G=KB$ corresponds to the fact that $K$ acts transitively on the germs of "quartiers" (you may prove this using the fondamental properties of the building stated in Bruhat-Tits, IHES, volume 1).
In fact doing the proofs this way is cheating ! For Bruhat and Tits prove the basic properties of the building by using properties of the valuated root datum, that is by doing row and column operations on matrices ...
But even if these proofs are not geniune "proofs", they allow you to "visualize" why these decompositions hold.