IT started on City trading floors last Wednesday morning.

Whispers spread between desks as stock screens flashed that shares in Britvic and AG Barr were rising. The mergers and acquisitions market might be soporific these days, but something was clearly up.

If there had been any hope of keeping this excitable cat in the bag, a few paragraphs from the Daily Mail's market reports service ensured otherwise. By mid-morning the two firms had no choice but to confirm to the stock market what was now widely rumoured – merger talks were afoot.

Surely that had to be a euphemism for the end of AG Barr, given that it was by far the smaller of the two? But the details did not bear this out. The announcement said Britvic shareholders would get 63% of the merged company and their chairman and finance director would retain their roles. But Roger White, Barr's chief executive of eight years, was being lined up for the top job. And there was no word of whether the new headquarters would be in Cumbernauld or Britvic's Hertfordshire.

Like the wee boy in the old Irn-Bru adverts who bends down a lamp-post to light his girlfriend's way, had team Barr turned out to be made from girders? Had the company that had been turning out bottles of pop since the days of Queen Victoria just pulled off one of the most audacious coups in Scottish business history?

We won't know until the two firms release further details, but that is the general impression. Barr has been something of a serial acquirer over the years, buying the likes of Tizer (1973), St Clements (1988) and Strathmore (2006), while growing organically.

And regardless of whether you see AG Barr as a patriotic champion or purveyor of sugary drinks, there is no question it has been having a good recession. The company has nearly doubled in the four years since it spent £60 million buying the Groupe Rubicon range of tropical juice drinks.

Barr might have spent the best part of its life trying to seduce the English with the orange girdery stuff, but it has finally hit the big time in the southeast selling the likes of mango and lychee juice, primarily to the Asian community. These go hand in hand with the company's KA range of fruit drinks, popular with Afro-Caribbeans and selling by the truckload. More than half of sales now come out of England and Wales.

Barr also does well out of Rockstar energy drinks, made under licence, and has masterminded a revival of chip-shop classics such as raspberryade and red kola. All these worship at the feet of Irn-Bru, of course, which still makes up nearly half the business and has 4% of the UK soft drinks market.

There have been a few setbacks, such as grim weather hitting sales in the past two summers, culminating in a recent profit warning. A delivery blunder over new equipment at the expanded Cumbernauld bottling plant cost nearly £1m.

Veteran Robin Barr also retired as chairman in 2009 in favour of former housebuilder Ronald Hanna, the first time a family member has not held the post since the company began. Nevertheless, pre-tax profits have risen from £21m in 2008 to £35m last year on a rise in sales from £148m to £237m. Consumers might not be spending money on much right now, but they clearly still have a soft spot for Barr drinks.

But Britvic dwarfs these numbers. With roots in the mid-19th century, when it was known as the British Vitamin Products Company, it sells five times as much as Barr each year with brands like Tango, Robinsons and J20. Where Barr makes 98% of its sales in the UK, regardless of all the press blurb about Irn-Bru's international popularity, Britvic gets about one-third of its sales overseas, mostly in Ireland and France.

Britvic also has a longstanding franchise to bottle and sell all the PepsiCo brands in the UK and Ireland, which includes drinks like 7Up and Lipton Ice Tea. These are worth about 40% of sales, a huge slug of the business, although licensed drinks sales are far less profitable than in-house brands once you have paid royalties. After the UK division of Coca-Cola, Britvic is the biggest soft-drinks seller in the country.

It had a good reputation under boss Paul Moody, a straight-talking salesman who got into soft drinks in the 1990s after stints pushing everything from crisps to dog food. But City sources say his reputation started suffering early in 2011 when sudden rises in the cost of raw materials like oil, sugar and steel forced him to U-turn on trading guidance and issue a profits warning.

He also had to admit the company's £170m takeover of Magners maker C&C's Irish soft drinks business in 2007 had gone pear-shaped. It might have been bad luck to have gone into Ireland just before it went down the tubes, but the £104m writedown did not do him any favours.

This year, things have gone from bad to worse. It has become apparent that Britvic has done a poorer job of passing on the rising cost of material prices to consumers than rivals like Barr.

The company also had to recall millions of bottles of Robinsons Fruit Shoot after an anti-spillage bottle-top turned out to be a choking hazard for children. First it said this would cost £1m to £5m, but this became £25m just days later. Once again, flip-flopping made a bad situation worse. Coupled with another bad profits warning over the summer due to more cost rises, Moody's reputation has been in tatters.

Charles Pick of Numis Securities says: "Moody hasn't done a bad job on the whole, but these are nasty incidents that have whittled down his fan club, I am afraid."

The result has been takeover mutters over the past couple of months involving the likes of Diageo or a private-equity group. What no-one guessed was that the Cumbernauld contingent had got in there first. Although last week's announcement said the talks were early-stage, rumour has it that they might go back as far as May.

The markets have reacted very well to the news. At the time of writing, Barr shares are up 17% on the week and Britvic's are up 10%.

White is seen as a better manager and investors are licking their lips at the prospect of putting a few more brands through the Britvic distribution machine. It consists of more than 1000 sales and marketing people, more staff than the entire Barr group.

Wayne Brown of Cannacord says: "Barr are under-weight in the large multiples. To insert them into the Pepsi distribution platform could be significant for the group. It's a transformational deal from that perspective. In the US [where Britvic has just started selling Fruit Shoot], the opportunity is quite exciting. In total, we are talking about tens of millions of pounds."

Charles Pick adds that White may see a chance to change the way Britvic does business. It gets about 70% of its turnover from supermarket promotions, which helps explain the monster sales figures but also the relatively low profit margins. It also relies heavily on pubs, particularly with J20, at a time when consumers are trading down to cheaper alternatives like draught soft drinks or avoiding pubs altogether.

In contrast, Barr does most of its business through chiller fridges in convenience stores and newsagents, which is more profitable and less sensitive to price rises. This is a key reason why Barr has found it easier to pass on material price rises to customers. Its pre-tax profit margin is over 14%, compared to Britvic's 8%.

"It may be that Roger White feels that Britvic could have made more money from its current sales base," says Pick. "He's always argued that it's better to go for sustainable gain rather than short-term quick fixes from promotions. We could see a much more hard-nosed approach to Britvic sales in future."

SOME observers are less sure about the deal, recalling that reverse takeovers such as Rentokil/BET can end in tears. They point to Britvic's Pepsi agreement, most of which is up for renewal in 2017. If PepsiCo went elsewhere, the business would be virtually halved overnight. The company also has debts approaching £500m, which at nearly three times top-line earnings is a big millstone for any new management team. This would likely mean a long period of consolidation if the deal goes through.

Finally, there is the question of control. Scot White is unlikely to decamp to Hertfordshire, but many people are wondering whether Barr will steadily shift away from its roots in the years to come.

Before any of that, the first question is if the deal will go through. Whoever leaked details to traders and journalists, we can be fairly sure it was not the Barr management. It would have suited them to be able to announce a fait accompli. Now they face the prospect of a takeover battle.

PepsiCo, which has a 5% stake in Britvic, is seen as an obvious candidate. It has said nothing so far, although the prospects of it counter-bidding are reduced by the fact that it would have approved the agreement announced last week.

Ollie Wehner, editor of Just-Drinks, says the soft drinks market is so fragmented beyond the Pepsis and Cokes that there could be any number of contenders. "It could be private equity, it could be another drinks company like maybe Red Bull or Monster. It's very difficult to say because it's such a large pool."

The two companies have said they will conclude one way or the other by October 3. So the Barr board can expect a monumental September, thrashing out the rest of the agreement while watching for any fins rising out of the water. Roger White will know only too well that the reputations of deal-makers who fail to cross the finish line often never recover.