Complex behaviour patterns can be learned, but (it appears that) they can also be inherited.
Example 1 The female Common Cuckoo (Cuculus canorus) is 'brood parasitic' in that it lays its eggs in the nests of other birds. This can't be a 'learned' behaviour, since the bird has never met its parents (except in unlaid egg form) The cuckoo somehow inherits this behaviour - presumably via some as-yet-undiscovered genetic mechanism.
Example 2 “The African peach-faced lovebird carries nesting materials to the nesting site by tucking them in its feathers. Its close relative, the Fischer's lovebird, uses its beak to transport nesting materials. The two species can hybridize. When they do so, the offspring succeed only in carrying nesting material in their beaks. Nevertheless, they invariably go through the motions of trying to tuck the materials in their feathers first.” source:
Other animals show much more complex behaviour patterns which can only have been inherited. (migration in salmon, eels, turtles, butterflies etc etc ).
It's possible that all innate behaviours (instincts) are somehow inherited, since the process is entirely without any explanation which could discount that mode of operation.
Despite more than a century of research (Darwin puzzled over it), there are currently no plausible theories - genetic or otherwise - as to how such complex behaviour patterns could be transferred.