Both these compounds have different structures due to the different state of hybridisation of the central atom i.e., phosphorus and iodine.
PCl5:sp3d
lF5:sp3d2
In , P is surrounded by 5 bond pairs and no lone pairs, whereas in , iodine atom is surrounded by 5 bond pairs and one lone pair; therefore the one lone pair in makes its shape different.