Even if you don't go in the bank but wait outside in the car, if you know your buddy is armed and goes in the bank, you can be punished just as harshly. This is known as accomplice liability.
The formal law is roughly as follows: If you solicit, encourage, command or request another person to commit a crime, you are as guilty as the one who actually does it. Obviously if you directly aid or assist in the planning or commission of the crime, you are also equally liable for the crime. You do not have to be present at the scene of the crime to be guilty. On the other hand, your mere presence at the crime scene and knowledge of the crime alone are not enough. You have to do something, or encourage, aid, or by your presence, support or encourage THE CRIME. If you are just there but also acting as a 'lookout,' then you are an accomplice.
I capitalized THE CRIME, since the state has to prove that you are involved in the particular crime charged. For example, if you agree to be the lookout for a burglary and your buddy heads toward the house and then assaults someone on the street on the way into the house, you would not be liable for the assault. It is a more complicated question if the person going in the house, assaults or kills someone inside since prosecutors might consider that part of the burglary crime.
In the drive-by shooting case from Ballard H.S. in the mid-1990's, the driver was convicted of murder in the second degree because he "knowingly facilitated the drive-by shooting." The prosecutor argued that old favorite: "in for a dime, in for a dollar." And on appeal the driver argued the jury instructions were misleading and the prosecutor's argument was simplistic and unfair. This area of law is so complex that his appeals went on until just last month. He had won a new trial at one point, but then the U.S. Supreme Court reversed that.
I am involved in a murder case, where I represent an uncharged suspect. In that same case, the alleged driver to the murder scene is currently on trial. His defense is that he had no idea that the two men in his car would later shoot the victim in front of a bar. The state probably can prove he had parked the car some distance away while he waited in the car. So the question will be whether they can prove he did so, knowing of their design to shoot when they left the car.
Another case I have is that of a young man accused of starting a fight outside a bar, where the 'victim' voluntarily went outside to confront him. Ordinarily that would be a misdemeanor assault. (A mutual fight is no defense for the person who threw the first punch.) However, when the two were grappling, my client's friend began punching and kicking the victim. The friend's blows caused the victim a fractured nose and cheek bone. My client did not do any serious damage. Yet my client is charged with a felony assault in the second degree. There, the issue will be if they were acting in concert or if the friend, unbidden by my client, just jumped in and acted on his own.
In federal court, the prosecutors frequently charge conspiracy crimes. In such a case, a person can be guilty when (1) two or more people agree to commit a crime, (2) when the accused joins this group knowing of its criminal purpose and intending to help it, and (3) someone performs an overt act for the purpose of carrying out the conspiracy. Take a mortgage fraud scheme, where people lie on their applications to get the loan. And then, never intending to live there, turn the property over to others who try to flip it at a higher price. Even if the person who filled out the application never benefitted from the scheme, a conspiracy charge would lie.
Another problem for co-conspirators, for example, is the schlep who agrees to move the hockey bag with marijuana it over the border. The schlep may be facing as much time as the owners of the dope. I like to explain this with the Macdonald's analogy. Imagine if making burgers were illegal like cocaine is. Then if you agree to flip some burgers for one of the golden arch stores, you are potentially liable for all of the whole corporate output. After all, everyone knows the signs say 'so many billions sold. . .' Of course the schlep could say he didn't know there were 100's of hockey bags involved. Perhaps. . .
In short, choose your friends carefully and don't do any favors such as carrying that bundle across the border . . .