Explanation of the quote
As the linked article notes, the background to Graham's remark is an exceptional level of conflict between President Trump and the Republican Senate caucus:
Angry phone calls and private badmouthing have devolved into open conflict, with the president threatening to oppose Republican senators who cross him, and [Senate Majority Leader] Mr. McConnell mobilizing to their defense.
Graham is referring to the NATO treaty as a metaphor for collective defense. He seems to be appealing for Republican Senators to form a united front in the face of attacks by Trump. His argument is that an attack on any individual Senator is an attack on the status of Republican Senators as a group -- and, perhaps, on the authority of the Senate itself.
In this context, "attack" means political opposition:
Mr. Trump has also continued to badger and threaten Mr. McConnell’s Senate colleagues, including Senator Jeff Flake of Arizona, whose Republican primary challenger was praised by Mr. Trump last week.
or threats to use the power of the executive branch in retaliation:
Senator Lisa Murkowski of Alaska told colleagues that when Mr. Trump’s interior secretary threatened to pull back federal funding for her state, she felt boxed in and unable to vote for the health care bill.
Regardless of where one stands on the conflict between Trump and the Senators, Graham's point appears sound. It would likely be easier for Trump to impose his will on the Senators if he can use "divide and rule" tactics, instead of facing a group united in opposition to his demands.
Precedents for conflict
Under Constitutional separation of powers, Congress is a branch of government of equal status to the presidency. The Senate was designed to resist short-term changes in public opinion, and act as a check on the intentions of the President and House. James Madison wrote in 1787:
The necessity of a senate is not less indicated by the propensity of all single and numerous assemblies, to yield to the impulse of sudden and violent passions, and to be seduced by factious leaders into intemperate and pernicious resolutions.
As such, conflict between President and Senate is not uncommon. Senators have traditionally been concerned to protect the status and authority of the Senate as an institution. Lyndon B Johnson (then Senate majority leader) said in 1959:
Our mandate is a mandate for confident and creative and constructive leadership -- beginning now, not two years hence [after the next Presidential election].
The current situation is unusual because:
The President is in conflict with a Senate majority from his own party
Instead of trying to negotiate and compromise, or influence public opinion in general, the President is directly attacking individual Senators (as in the examples of Flake and Murkowski above).
There is no precedent for the second point, and the Senators regard Trump's tactics as deeply improper. This accounts for some of the hostility between Trump and the Senate.