The cabinet ministers serve at the discretion of the president. Formally, they are not named by the prime minister but by the president “on the advice of the prime minister”. The most important decisions, including naming ambassadors or key military leaders require a décret en conseil de ministres signed by the president with a countersignature by the prime minister or the relevant ministers. The president's authority is very extensive and neither the prime minister nor the defense minister have any role in the military chain-of-command.
In practice nowadays, ministers merely do the president's bidding. They have a day-to-day management and advisory role (in which capacity they might butt heads with powerful presidential advisors) but do not take any important decision on their own. Whether something is announced directly by the president or left to the prime minister or a cabinet minister is mostly a matter of public relations and whether the president finds it convenient to shield himself behind his ministers (no woman ever held the position). Jean-Pierre Chevènement whose three stints in the cabinet all ended in resignation famously summed it up with the sentence “a minister has to keep his mouth shut; if he wants to open it, he resigns”.
Most presidents switched prime minister at some point during their term, as a tactic to reboot their presidency or show they want to respond to some dissatisfaction with their policies (that in spite of the fact that the president is ultimately responsible for those policies, not the prime minister). Even when ministers are notoriously at odd with each other or the preident and trying to position themselves ahead of an election (say Dominique de Villepin and Nicolas Sarkozy), it doesn't play out as an issue of jurisdiction as much as a lack of communication or competing spin through leaks to the media.
Importantly, the system works completely differently when the president's party doesn't have a majority in parliament (cohabitation) and the president is forced to name a prime minister from the opposition. In that case, the prime minister has a much bigger role and the constitution doesn't really clarify how this is supposed to work, especially when it comes to defense and foreign affairs.