Plants and many bacteria and other microorganisms make phenylalanine from a molecule called prephenate. Phenylpyruvate is produced when the carboxyl group is removed. In a series of a few more reactions pathways involving glutamate, phenylalanine is produced along with α-ketoglutarate.
Relating the details of a biochemical pathway as above is best done with a diagram and the second link below shows the pathways, plus a little more informaton about alternate molecules which can be synthesized.
One important fact to relate is that most animals can’t produce this amino acid and it is considered one of the essential amino acids. The fact that we need to get this from our diet is another way we are interdependent on plants for our very existence.